diff --git a/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java b/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java index b3678b0..82c9f92 100644 --- a/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java +++ b/src/main/java/de/ellpeck/prettypipes/network/PipeNetwork.java @@ -143,14 +143,12 @@ public class PipeNetwork implements ICapabilitySerializable, GraphL return false; this.startProfile("find_destination"); for (BlockPos pipePos : this.getOrderedNetworkNodes(startPipePos)) { - if (pipePos.equals(startPipePos)) - continue; PipeTileEntity pipe = this.getPipe(pipePos); BlockPos dest = pipe.getAvailableDestination(stack, false, preventOversending); - if (dest != null) { - this.endProfile(); - return this.routeItemToLocation(startPipePos, startInventory, pipe.getPos(), dest, itemSupplier); - } + if (dest == null || dest.equals(startInventory)) + continue; + this.endProfile(); + return this.routeItemToLocation(startPipePos, startInventory, pipe.getPos(), dest, itemSupplier); } this.endProfile(); return false; @@ -191,7 +189,7 @@ public class PipeNetwork implements ICapabilitySerializable, GraphL } public ItemStack requestItem(NetworkLocation location, BlockPos destPipe, BlockPos destInventory, ItemStack stack, ItemEqualityType... equalityTypes) { - if (location.pipePos.equals(destPipe)) + if (location.getPos().equals(destInventory)) return stack; ItemStack remain = stack.copy(); for (int slot : location.getStackSlots(this.world, stack, equalityTypes)) {