Skip to content
Permalink
Browse files

Fixed a power acceleration loop with transformers.

  • Loading branch information...
Ri5ux Ri5ux
Ri5ux authored and Ri5ux committed Jul 21, 2019
1 parent 4ef1c11 commit 3f42051e2b44c200cb467c597788b9d13de9d238
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/main/java/org/avp/tile/TileEntityTransformer.java
@@ -89,6 +89,24 @@ public void update()
}
}
}

@Override
public boolean canReceiveVoltageFromSide(EnumFacing from)
{
TileEntity t = this.world.getTileEntity(this.getPos().offset(direction));

if (t != null && t instanceof TileEntityElectrical)
{
TileEntityElectrical e = (TileEntityElectrical) t;

if (super.canReceiveVoltageFromSide(from) && e.getVoltage() > this.getVoltage() && this.getVoltage() > 0)
{
return false;
}
}

return super.canReceiveVoltageFromSide(from);
}

@Override
public EnumFacing getSourcePowerDirection()

0 comments on commit 3f42051

Please sign in to comment.
You can’t perform that action at this time.