From ed6499a1fab4503af9b6b41c6b2b54471b7f9551 Mon Sep 17 00:00:00 2001 From: Humungus Date: Sat, 10 May 2014 19:21:56 +0200 Subject: [PATCH] A simple fix for the wire flicker --- .../buildcraft/transport/BlockGenericPipe.java | 17 ++++++++++++++++- common/buildcraft/transport/Pipe.java | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index 10bc7bfe..033caf9e 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -54,6 +54,7 @@ import buildcraft.core.BlockIndex; import buildcraft.core.CoreConstants; import buildcraft.core.CreativeTabBuildCraft; import buildcraft.core.ItemRobot; +import buildcraft.core.TileBuffer; import buildcraft.core.robots.EntityRobot; import buildcraft.core.robots.RobotAIDocked; import buildcraft.core.utils.MatrixTranformations; @@ -878,7 +879,9 @@ public class BlockGenericPipe extends BlockBuildCraft { if (!pipe.wireSet[color.ordinal()]) { pipe.wireSet[color.ordinal()] = true; pipe.signalStrength[color.ordinal()] = 0; - pipe.container.scheduleNeighborChange(); + + pipe.updateSignalState(); + pipe.container.scheduleRenderUpdate(); return true; } return false; @@ -890,7 +893,19 @@ public class BlockGenericPipe extends BlockBuildCraft { dropWire(color, pipe); } pipe.wireSet[color.ordinal()] = false; + + TileBuffer neighbours[] = pipe.container.getTileCache(); + + if(neighbours != null) { + for(int i = 0; i < 6; i++) { + if (neighbours[i] != null && neighbours[i].getTile() instanceof TileGenericPipe && !neighbours[i].getTile().isInvalid()) { + ((TileGenericPipe) neighbours[i].getTile()).pipe.updateSignalState(); + } + } + } pipe.container.scheduleRenderUpdate(); + + return true; } return false; diff --git a/common/buildcraft/transport/Pipe.java b/common/buildcraft/transport/Pipe.java index c29fdeda..55415c0c 100644 --- a/common/buildcraft/transport/Pipe.java +++ b/common/buildcraft/transport/Pipe.java @@ -141,7 +141,6 @@ public abstract class Pipe implements IDropControlInven public void onNeighborBlockChange(int blockId) { transport.onNeighborBlockChange(blockId); - updateSignalState(); } public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {