From 9fe3fa1c7cdbad77d0e0773a529432f3f04b879e Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:01:14 -0500 Subject: [PATCH] Fixed corner case (cough mekanism) where in a energy storage accepts a simulated transfer, but refuses the actual transfer. --- .../mod/tile/TileEntityLaserRelayEnergy.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java index ebb878e29..191a7bb18 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -218,9 +218,11 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay { if (deduct >= theoreticalReceived) { //Happens with small numbers deduct = 0; } - - trans += cap.receiveEnergy(theoreticalReceived - deduct, simulate); - trans += deduct; + int actual = cap.receiveEnergy(theoreticalReceived - deduct, simulate); + if (actual > 0) { + trans += actual; + trans += deduct; + } } return trans;