From c178f471f42aa8fec31c28d0eb057d81a7698d7d Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Thu, 14 Aug 2014 23:05:32 +0100 Subject: [PATCH] Cherry pick: Fix not sending tile updates Conflicts: src/main/java/mekanism/common/multipart/PartSidedPipe.java --- .../multipart/PartLogisticalTransporter.java | 2 +- .../common/multipart/PartSidedPipe.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java b/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java index fd7281241..7dfb6b333 100644 --- a/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java @@ -692,7 +692,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti { TransporterUtils.incrementColor(this); refreshConnections(); - tile().notifyPartChange(this); + tile().notifyTileChange(); Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tile()), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tile()))); player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.toggleColor") + ": " + (color != null ? color.getName() : EnumColor.BLACK + MekanismUtils.localize("gui.none")))); diff --git a/src/main/java/mekanism/common/multipart/PartSidedPipe.java b/src/main/java/mekanism/common/multipart/PartSidedPipe.java index d4dc9ef6a..506343139 100644 --- a/src/main/java/mekanism/common/multipart/PartSidedPipe.java +++ b/src/main/java/mekanism/common/multipart/PartSidedPipe.java @@ -464,6 +464,16 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, protected void onRefresh() {} + public void redstoneRefresh() + { + boolean nowPowered = redstoneReactive && world().isBlockIndirectlyGettingPowered(x(), y(), z()); + + if(nowPowered != redstonePowered) + { + refreshConnections(); + } + } + public void refreshConnections() { byte possibleTransmitters = getPossibleTransmitterConnections(); @@ -486,7 +496,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, onRedstoneJoin(); } - tile().notifyPartChange(this); + tile().notifyTileChange(); } } @@ -529,6 +539,12 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, refreshConnections(); } + @Override + public void onNeighborChanged() + { + redstoneRefresh(); + } + @Override public void onPartChanged(TMultiPart part) {