fixed a crash with trying to find a path to a nonexistant pipe

This commit is contained in:
Ellpeck 2020-04-17 17:40:04 +02:00
parent 10645ac54d
commit 4368f2945b

View file

@ -136,9 +136,9 @@ public class PipeNetwork implements ICapabilitySerializable<CompoundNBT>, GraphL
}
public boolean routeItemToLocation(BlockPos startPipePos, BlockPos startInventory, BlockPos destPipe, BlockPos destInventory, Function<Float, PipeItem> itemSupplier) {
if (!this.isNode(startPipePos))
if (!this.isNode(startPipePos) || !this.isNode(destPipe))
return false;
if (!this.world.isBlockLoaded(startPipePos))
if (!this.world.isBlockLoaded(startPipePos) || !this.world.isBlockLoaded(destPipe))
return false;
PipeTileEntity startPipe = this.getPipe(startPipePos);
if (startPipe == null)