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 tick() { for (Player player : this.players) { ((ServerPlayer) player).tick(); } for (BlockEntity entity : this.entities) { if (entity.getController() != null) entity.getController().tick(); } }