Ad-Hoc Networks can no longer tunnel; Tunnels.

This commit is contained in:
AlgorithmX2 2014-07-06 16:00:05 -05:00
parent 6ce5a8f4c5
commit 70ef70a42e

View file

@ -1,5 +1,6 @@
package appeng.me.cache; package appeng.me.cache;
import java.util.EnumSet;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
@ -47,6 +48,7 @@ public class PathGridCache implements IPathingGrid
int ticksUntilReady = 20; int ticksUntilReady = 20;
Set<TileController> controllers = new HashSet(); Set<TileController> controllers = new HashSet();
Set<IGridNode> requireChannels = new HashSet(); Set<IGridNode> requireChannels = new HashSet();
Set<IGridNode> blockDense = new HashSet();
final IGrid myGrid; final IGrid myGrid;
private HashSet<IPathItem> semiOpen = new HashSet(); private HashSet<IPathItem> semiOpen = new HashSet();
@ -165,10 +167,15 @@ public class PathGridCache implements IPathingGrid
{ {
if ( !semiOpen.contains( nodes ) ) if ( !semiOpen.contains( nodes ) )
{ {
IGridBlock gb = nodes.getGridBlock();
EnumSet<GridFlags> flags = gb.getFlags();
if ( flags.contains( GridFlags.DENSE_CHANNEL ) && !blockDense.isEmpty() )
return 9;
depth++; depth++;
IGridBlock gb = nodes.getGridBlock(); if ( flags.contains( GridFlags.MULTIBLOCK ) )
if ( gb.getFlags().contains( GridFlags.MULTIBLOCK ) )
{ {
IGridMultiblock gmb = (IGridMultiblock) gb; IGridMultiblock gmb = (IGridMultiblock) gb;
Iterator<IGridNode> i = gmb.getMultiblockNodes(); Iterator<IGridNode> i = gmb.getMultiblockNodes();
@ -200,9 +207,14 @@ public class PathGridCache implements IPathingGrid
recalculateControllerNextTick = true; recalculateControllerNextTick = true;
} }
if ( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) ) EnumSet<GridFlags> flags = gridNode.getGridBlock().getFlags();
if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) )
requireChannels.remove( gridNode ); requireChannels.remove( gridNode );
if ( flags.contains( GridFlags.CANNOT_CARRY_DENSE ) )
blockDense.remove( gridNode );
repath(); repath();
} }
@ -215,9 +227,14 @@ public class PathGridCache implements IPathingGrid
recalculateControllerNextTick = true; recalculateControllerNextTick = true;
} }
if ( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) ) EnumSet<GridFlags> flags = gridNode.getGridBlock().getFlags();
if ( flags.contains( GridFlags.REQUIRE_CHANNEL ) )
requireChannels.add( gridNode ); requireChannels.add( gridNode );
if ( flags.contains( GridFlags.CANNOT_CARRY_DENSE ) )
blockDense.add( gridNode );
repath(); repath();
} }