@Override
protected void updateServerSide() {
super.updateServerSide();
if (energyManager.getTotalEnergyStored() == 0) {
ITileStructure central = getCentralTE();
if (!(central instanceof TileForestry))
return;
TileForestry centralHousing = (TileForestry) central;
centralHousing.setErrorState(EnumErrorCode.NOPOWER);
return;
}
if (activationDelay > 0) {
activationDelay--;
return;
}
// Hard limit to 4 cycles / second.
if (workCounter < WORK_CYCLES && energyManager.consumeEnergyToDoWork()) {
workCounter++;
}
if (workCounter >= WORK_CYCLES && worldObj.getTotalWorldTime() % 5 == 0) {
ITileStructure central = getCentralTE();
if (!(central instanceof IFarmHousing))
return;
if (((IFarmHousing) central).doWork()) {
workCounter = 0;