Fix that self powered controller didnt count as controller in grid. (#691)

Co-authored-by: Maya <[email protected]>
This commit is contained in:
lordIcocainandMaya authored and GitHub committed 2025-03-15 15:30:53 +00:00
1 parent 597708e0e0
commit 47b72fb6d6
1 file changed
+14
+14
View File
@@ -48,6 +48,7 @@ import appeng.me.pathfinding.ControllerValidator;
import appeng.me.pathfinding.IPathItem;
import appeng.me.pathfinding.PathSegment;
import appeng.tile.networking.TileController;
import appeng.tile.networking.TileCreativeEnergyController;
import appeng.util.Platform;
public class PathGridCache implements IPathingGrid {
@@ -126,6 +127,19 @@ public class PathGridCache implements IPathingGrid {
}
}
}
for (final IGridNode node : this.myGrid.getMachines(TileCreativeEnergyController.class)) {
closedList.add((IPathItem) node);
for (final IGridConnection gcc : node.getConnections()) {
final GridConnection gc = (GridConnection) gcc;
if (!(gc.getOtherSide(node).getMachine() instanceof TileController)) {
final List<IPathItem> open = new LinkedList<>();
closedList.add(gc);
open.add(gc);
gc.setControllerRoute((GridNode) node, true);
this.active.add(new PathSegment(this, open, this.semiOpen, closedList));
}
}
}
}
}