Made Laser Relays not try to input back into the thing they got energy from

Closes #425
This commit is contained in:
Ellpeck 2016-12-01 18:16:01 +01:00
parent cfd6506eb3
commit fba447376b
2 changed files with 12 additions and 0 deletions

View file

@ -147,7 +147,13 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay{
TileEntity relayTile = this.world.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;

View file

@ -143,7 +143,13 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements
TileEntity relayTile = this.world.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;