Skip to content

Commit

Permalink
fix pathfinding failure
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Sep 2, 2024
1 parent a50f02e commit 9cdcd42
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ public static class Pathfinder {
private final InventoryNetwork network;
private final BlockPos start;
private final BlockPos finalNode;
private final long finalNodeLong;
private final TransporterStack transportStack;
private final ItemStack data;
private final DestChecker destChecker;
Expand All @@ -383,6 +384,7 @@ public Pathfinder(InventoryNetwork network, Level world, BlockPos finalNode, Blo
this.network = network;
this.world = world;
this.finalNode = finalNode;
this.finalNodeLong = finalNode.asLong();
this.start = start;
transportStack = stack;
this.data = data;
Expand Down Expand Up @@ -477,7 +479,7 @@ private boolean isValidDestination(BlockPos start, @Nullable LogisticalTransport
if (startTransporter != null && neighbor.equals(finalNode)) {
BlockEntity neighborTile = WorldUtils.getTileEntity(world, chunkMap, neighbor);
if (destChecker.isValid(world, neighbor, neighborTile, transportStack, data, direction)) {
if (startTransporter.canEmitTo(direction) || (finalNode.equals(transportStack.homeLocation) && startTransporter.canConnect(direction))) {
if (startTransporter.canEmitTo(direction) || (finalNodeLong == transportStack.homeLocation && startTransporter.canConnect(direction))) {
//If it is, and we can emit to it (normal or push mode),
// or it is the home location of the stack (it is returning due to not having been able to get to its destination) and
// we can connect to it (normal, push, or pull (should always be pull as otherwise canEmitTo would have been true)),
Expand Down

0 comments on commit 9cdcd42

Please sign in to comment.