Mekanism

Mekanism

111M Downloads

Mekanism use receiveEnergy(1, true) instead of calling canReceive()

DBotThePony opened this issue ยท 2 comments

commented

Issue description:

if (itemstack.getCapability(CapabilityEnergy.ENERGY, null).receiveEnergy(1, true) > 0) {

return acceptor.receiveEnergy(side, 1, true) > 0;

This cause my GTCE <-> FE bridge to fail with Mekanism since machines (for balance) accept only certain minimal amount of FE at once, below that point they won't accept anything

commented

Honestly I feel that there could be implementation quirks for any value we simulate. I'd rather leave our implementation as-is.

commented

While unfortunate for your case, it is technically correct. Have a look at the reference implementation at net.minecraftforge.energy.EnergyStorage#canReceive - it only checks if it allows any receiving.

I don't see a reason why we can't simulate Integer.MAX_VALUE though, which in theory should solve your implementation quirk