[5.84] placing power cell next to an incomplete WOOT farm crashes server
kreezxil opened this issue ยท 4 comments
Report with WOOT. That's a bug where they don't correctly handle 'null' direction for energy in their energy capability handler (you can tell them that). i.e. basically hasCapability with null facing returns true but getCapability with null facing returns null. That's a bug. Best is that they support null facing correctly
McJty,, I'm having a bit of trouble understanding the issue here and I just want to make sure that I'm handling this correctly. I also cannot replicate the problem so I'm down to code inspection.
From the below in my TileEntityMobFactory class
-
hasCapability - for ENERGY always returning null regardless of facing
-
getCapability - for ENERGY always returning non-null regardless of facing
protected EnergyManager energyManager = new EnergyManager(EnergyManager.RF_STORED, EnergyManager.MAX_RF_TICK, this);
@OverRide
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
return capability == CapabilityEnergy.ENERGY;
}@OverRide
public T getCapability(Capability capability, EnumFacing facing) {
if (capability == CapabilityEnergy.ENERGY) {
IEnergyStorage energyStorage = energyManager;
return (T)energyStorage;
}
return super.getCapability(capability, facing);
}