From 9cdcd42e5b012584f4b88bb710c9972b6a79abdb Mon Sep 17 00:00:00 2001 From: Thiakil Date: Mon, 2 Sep 2024 11:14:18 +0800 Subject: [PATCH] fix pathfinding failure --- .../common/content/transporter/TransporterPathfinder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java b/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java index 164b5584dd0..397b5acf374 100644 --- a/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java +++ b/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java @@ -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; @@ -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; @@ -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)),