From de46e22840c8d0a26ed61e7533711529b7c9267e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 3 Nov 2016 10:54:28 +0100 Subject: [PATCH] Fix the item viewer, in very special cases, not updating its inventories --- .../actuallyadditions/mod/tile/TileEntityItemViewer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java index 994d71ef8..8387aa5e0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java @@ -27,6 +27,8 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{ private final List genericInfos = new ArrayList(); private final Map specificInfos = new HashMap(); public TileEntityLaserRelayItem connectedRelay; + + private Network oldNetwork; private int lastNetworkChangeAmount = -1; public TileEntityItemViewer(){ @@ -79,7 +81,7 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{ private void queryAndSaveData(){ if(this.connectedRelay != null){ Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.connectedRelay.getPos(), this.worldObj); - if(network != null && this.lastNetworkChangeAmount != network.changeAmount){ + if(network != null && (this.oldNetwork != network || this.lastNetworkChangeAmount != network.changeAmount)){ this.genericInfos.clear(); this.specificInfos.clear(); @@ -98,6 +100,7 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{ } } + this.oldNetwork = network; this.lastNetworkChangeAmount = network.changeAmount; } }