mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Fix the item viewer, in very special cases, not updating its inventories
This commit is contained in:
parent
d5ee51ff46
commit
de46e22840
1 changed files with 4 additions and 1 deletions
|
@ -27,6 +27,8 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
|
||||||
private final List<GenericItemHandlerInfo> genericInfos = new ArrayList<GenericItemHandlerInfo>();
|
private final List<GenericItemHandlerInfo> genericInfos = new ArrayList<GenericItemHandlerInfo>();
|
||||||
private final Map<Integer, SpecificItemHandlerInfo> specificInfos = new HashMap<Integer, SpecificItemHandlerInfo>();
|
private final Map<Integer, SpecificItemHandlerInfo> specificInfos = new HashMap<Integer, SpecificItemHandlerInfo>();
|
||||||
public TileEntityLaserRelayItem connectedRelay;
|
public TileEntityLaserRelayItem connectedRelay;
|
||||||
|
|
||||||
|
private Network oldNetwork;
|
||||||
private int lastNetworkChangeAmount = -1;
|
private int lastNetworkChangeAmount = -1;
|
||||||
|
|
||||||
public TileEntityItemViewer(){
|
public TileEntityItemViewer(){
|
||||||
|
@ -79,7 +81,7 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
|
||||||
private void queryAndSaveData(){
|
private void queryAndSaveData(){
|
||||||
if(this.connectedRelay != null){
|
if(this.connectedRelay != null){
|
||||||
Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.connectedRelay.getPos(), this.worldObj);
|
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.genericInfos.clear();
|
||||||
this.specificInfos.clear();
|
this.specificInfos.clear();
|
||||||
|
|
||||||
|
@ -98,6 +100,7 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.oldNetwork = network;
|
||||||
this.lastNetworkChangeAmount = network.changeAmount;
|
this.lastNetworkChangeAmount = network.changeAmount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue