public BlockEntity getBlockEntityFromId(int id) { for (BlockEntity entity : this.entities) { if (entity.getEntityId() == id) return entity; } return null; }
public void removeBlockEntity(int id) { for (BlockEntity entity : this.entities) { if (entity.getEntityId() == id) { if (entity.getController() != null) entity.getController().onDeath(); EventFactory.callEvent(new EntityDeathEvent(entity)); this.entities.remove(entity); } } }
public void removeBlockEntity(BlockEntity entity) { this.removeBlockEntity(entity.getEntityId()); }