Made mechanical network not pathfind unless the amount of generators changed
This commit is contained in:
parent
18ae602065
commit
a7f19b20a2
2 changed files with 15 additions and 13 deletions
|
@ -47,7 +47,7 @@ public class PartGear extends PartMechanical implements IMechanical
|
|||
@Override
|
||||
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
||||
{
|
||||
System.out.println(world().isRemote + ": " + getNetwork());
|
||||
//System.out.println(world().isRemote + ": " + getNetwork());
|
||||
|
||||
if (BlockAdvanced.isUsableWrench(player, player.getCurrentEquippedItem(), tile().xCoord, tile().yCoord, tile().zCoord))
|
||||
{
|
||||
|
|
|
@ -74,8 +74,8 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
|
|||
/**
|
||||
* Calculation rotations of all generators.
|
||||
*/
|
||||
prevGenerators = generators;
|
||||
|
||||
if (!(prevGenerators.equals(generators)) && generators.size() > 0)
|
||||
{System.out.println("UPDA PATH");
|
||||
Set<IMechanical> closedSet = new LinkedHashSet<IMechanical>();
|
||||
|
||||
for (IMechanical generatorNode : generators)
|
||||
|
@ -89,7 +89,9 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical>
|
|||
}
|
||||
}
|
||||
|
||||
prevGenerators = new LinkedHashSet<>(generators);
|
||||
generators.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate load
|
||||
|
|
Loading…
Reference in a new issue