diff --git a/CHANGELOG.md b/CHANGELOG.md index 178c3d856..39b345bfe 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Grids now do not sort if you interact with it while holding shift (Darkere) - Fixed Pattern Grid causing world hanging on load (raoulvdberge) - Fixed External Storage not refreshing when the storage is broken or replaced (raoulvdberge) +- Fixed delay in block update when placing a cable block (raoulvdberge) ### 1.7 NOTE: This is an alpha release. Bugs may happen. Remember to take backups. diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/CableBlock.java b/src/main/java/com/raoulvdberge/refinedstorage/block/CableBlock.java index 5faef3d5d..54dac262b 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/CableBlock.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/CableBlock.java @@ -17,7 +17,7 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; -import net.minecraft.world.World; +import net.minecraft.world.IWorld; import javax.annotation.Nullable; @@ -57,10 +57,8 @@ public class CableBlock extends NetworkNodeBlock { @Override @SuppressWarnings("deprecation") - public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) { - super.neighborChanged(state, world, pos, block, fromPos, isMoving); - - world.setBlockState(pos, getState(state, world, pos)); + public BlockState updatePostPlacement(BlockState state, Direction dir, BlockState facingState, IWorld world, BlockPos pos, BlockPos facingPos) { + return getState(state, world, pos); } @Override @@ -101,7 +99,7 @@ public class CableBlock extends NetworkNodeBlock { return getState(getDefaultState(), ctx.getWorld(), ctx.getPos()); } - private boolean hasNode(World world, BlockPos pos, BlockState state, Direction direction) { + private boolean hasNode(IWorld world, BlockPos pos, BlockState state, Direction direction) { if (getDirection() != BlockDirection.NONE && state.get(getDirection().getProperty()).getOpposite() == direction) { return false; } @@ -114,7 +112,7 @@ public class CableBlock extends NetworkNodeBlock { return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent(); } - private BlockState getState(BlockState currentState, World world, BlockPos pos) { + private BlockState getState(BlockState currentState, IWorld world, BlockPos pos) { boolean north = hasNode(world, pos.offset(Direction.NORTH), currentState, Direction.SOUTH); boolean east = hasNode(world, pos.offset(Direction.EAST), currentState, Direction.WEST); boolean south = hasNode(world, pos.offset(Direction.SOUTH), currentState, Direction.NORTH);