From d8af7636ee83cbfd494de3013a92131c916499eb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 1 Dec 2016 18:23:26 +0100 Subject: [PATCH] made laser relays not try to input back into the thing they got energy from --- .../mod/tile/TileEntityLaserRelayEnergy.java | 6 ++++++ .../mod/tile/TileEntityLaserRelayFluids.java | 6 ++++++ 2 files changed, 12 insertions(+) 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 89c4582f9..ed87181c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -123,7 +123,13 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements TileEntity relayTile = this.worldObj.getTileEntity(relay); if(relayTile instanceof TileEntityLaserRelayEnergy){ TileEntityLaserRelayEnergy theRelay = (TileEntityLaserRelayEnergy)relayTile; + int amount = theRelay.receiversAround.size(); + if(theRelay == this && theRelay.receiversAround.containsKey(from)){ + //So that the tile energy was gotten from isn't factored into the amount + amount--; + } + if(amount > 0){ relaysThatWork.add(theRelay); totalReceiverAmount += amount; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java index 25f6c3386..d7d259a97 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java @@ -117,7 +117,13 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements TileEntity relayTile = this.worldObj.getTileEntity(relay); if(relayTile instanceof TileEntityLaserRelayFluids){ TileEntityLaserRelayFluids theRelay = (TileEntityLaserRelayFluids)relayTile; + int amount = theRelay.receiversAround.size(); + if(theRelay == this && theRelay.receiversAround.containsKey(from)){ + //So that the tile energy was gotten from isn't factored into the amount + amount--; + } + if(amount > 0){ relaysThatWork.add(theRelay); totalReceiverAmount += amount;