private void addPendingNodes() {
if (!this.pendingNodes.isEmpty()) {
for (PathNode node : this.pendingNodes) {
Block startRail = node.location.getBlock();
RailType startType = RailType.getType(startRail);
if (startType == RailType.NONE) {
// Track type can not be identified
continue;
}
if (node.containsSwitcher()) {
if (DEBUG_MODE) {
System.out.println("NODE " + node.getDisplayName() + " CONTAINS A SWITCHER");
}
// Check north-east-south-west for possible routes
for (BlockFace dir : FaceUtil.AXIS) {
scheduleNode(node, startType.findMinecartPos(startRail).getRelative(dir), dir);
}
} else {
// Only check available routes
for (BlockFace dir : startType.getPossibleDirections(startRail)) {
scheduleNode(node, startType.getNextPos(startRail, dir), dir);
}
}
}
this.pendingNodes.clear();
}