mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Add "No Power" error state to multifarm
This commit is contained in:
1 parent
63ec46d830
commit
220ce0b6a2
1 file changed
+11
@@ -12,6 +12,7 @@ package forestry.farming.gadgets;
|
||||
|
||||
import forestry.api.core.ITileStructure;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.core.EnumErrorCode;
|
||||
import forestry.core.interfaces.IPowerHandler;
|
||||
import forestry.energy.EnergyManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -63,6 +64,16 @@ public class TileGearbox extends TileFarm implements IPowerHandler {
|
||||
protected void updateServerSide() {
|
||||
super.updateServerSide();
|
||||
|
||||
if (energyManager.getTotalEnergyStored() == 0) {
|
||||
ITileStructure central = getCentralTE();
|
||||
if (!(central instanceof TileFarmPlain))
|
||||
return;
|
||||
|
||||
TileFarmPlain centralHousing = (TileFarmPlain) central;
|
||||
centralHousing.setErrorState(EnumErrorCode.NOPOWER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (activationDelay > 0) {
|
||||
activationDelay--;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user