Fixed corner case (cough mekanism) where in a energy storage accepts a simulated transfer, but refuses the actual transfer.

This commit is contained in:
Flanks255 2024-10-30 11:01:14 -05:00
parent ae9c72bb73
commit 9fe3fa1c7c

View file

@ -218,9 +218,11 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
if (deduct >= theoreticalReceived) { //Happens with small numbers if (deduct >= theoreticalReceived) { //Happens with small numbers
deduct = 0; deduct = 0;
} }
int actual = cap.receiveEnergy(theoreticalReceived - deduct, simulate);
trans += cap.receiveEnergy(theoreticalReceived - deduct, simulate); if (actual > 0) {
trans += deduct; trans += actual;
trans += deduct;
}
} }
return trans; return trans;