RFTools

RFTools

74M Downloads

[5.84] placing power cell next to an incomplete WOOT farm crashes server

kreezxil opened this issue ยท 4 comments

commented

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

commented

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);
    }

commented

Sorry, didn't yet have time to check this out. Will try to check tomorrow

commented

McJty please ignore the information I provided.
Kreezxil has now helped me reproduce the issue and it is with a different TE (in my mod) than originally reported. That other TE does look like it can return true for hasCapability but null for getCapability.