From f6d2de4c4361818e476b5155322b8c61d07aeea9 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 1 Aug 2015 23:17:37 -0400 Subject: [PATCH] #2673 Issues with conduits on chunk borders This is a somewhat experimental change, needs further testing --- .../crazypants/enderio/conduit/AbstractConduit.java | 12 +++++++----- .../java/crazypants/enderio/conduit/ConduitUtil.java | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/crazypants/enderio/conduit/AbstractConduit.java b/src/main/java/crazypants/enderio/conduit/AbstractConduit.java index 02b5140c..03569c99 100644 --- a/src/main/java/crazypants/enderio/conduit/AbstractConduit.java +++ b/src/main/java/crazypants/enderio/conduit/AbstractConduit.java @@ -432,12 +432,14 @@ public abstract class AbstractConduit implements IConduit { } protected void updateNetwork(World world) { - if(getNetwork() == null) { + BlockCoord pos = getLocation(); + if(getNetwork() == null && world.blockExists(pos.x, pos.y, pos.z)) { ConduitUtil.ensureValidNetwork(this); - if(getNetwork() != null && !world.isRemote && bundle != null) { - world.notifyBlocksOfNeighborChange(bundle.getEntity().xCoord, bundle.getEntity().yCoord, bundle.getEntity().zCoord, - bundle.getEntity().getBlockType()); - } + // TODO figure out if removing this causes anything horrible to happen. Initial testing shows no difference. +// if(getNetwork() != null && !world.isRemote && bundle != null) { +// world.notifyBlocksOfNeighborChange(bundle.getEntity().xCoord, bundle.getEntity().yCoord, bundle.getEntity().zCoord, +// bundle.getEntity().getBlockType()); +// } } } diff --git a/src/main/java/crazypants/enderio/conduit/ConduitUtil.java b/src/main/java/crazypants/enderio/conduit/ConduitUtil.java index 8a9798c1..92aa81fd 100644 --- a/src/main/java/crazypants/enderio/conduit/ConduitUtil.java +++ b/src/main/java/crazypants/enderio/conduit/ConduitUtil.java @@ -279,8 +279,8 @@ public class ConduitUtil { return equipped.getItem() == EnderIO.itemConduitProbe; } - public static T getConduit(IBlockAccess world, int x, int y, int z, Class type) { - if(world == null) { + public static T getConduit(World world, int x, int y, int z, Class type) { + if(world == null || !world.blockExists(x, y, z)) { return null; } TileEntity te = world.getTileEntity(x, y, z); @@ -291,11 +291,11 @@ public class ConduitUtil { return null; } - public static T getConduit(IBlockAccess world, TileEntity te, ForgeDirection dir, Class type) { + public static T getConduit(World world, TileEntity te, ForgeDirection dir, Class type) { return ConduitUtil.getConduit(world, te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, type); } - public static Collection getConnectedConduits(IBlockAccess world, int x, int y, int z, Class type) { + public static Collection getConnectedConduits(World world, int x, int y, int z, Class type) { TileEntity te = world.getTileEntity(x, y, z); if(!(te instanceof IConduitBundle)) { return Collections.emptyList();