Skip to content
Permalink
Browse files

Fixed an issue that allows some non-open end powerlines to arc.

  • Loading branch information...
Ri5ux Ri5ux
Ri5ux authored and Ri5ux committed Jul 15, 2019
1 parent 48a246b commit a7a9ad4b84bd5b1662920462542ed89dd97d5b16
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/main/java/org/avp/tile/TileEntityPowerline.java
@@ -49,16 +49,24 @@ public void update()
{
IVoltageProvider provider = (IVoltageProvider) electrical;

if (electrical.canProvideEnergyToReceiver(direction) && provider.canConnectPower(direction) && electrical.getVoltage() < this.getVoltage())
if (electrical.canProvideEnergyToReceiver(direction) && provider.canConnectPower(direction))
{
connections++;
}
}

if (electrical instanceof IVoltageReceiver)
{
if (electrical.getVoltage() < this.getVoltage())
{
connections++;
}
}
}
}

boolean canArc = connections < 1;

boolean canArc = connections <= 1;
if (canArc)
{
Random rand = new Random();

0 comments on commit a7a9ad4

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