*Actually* fixed Item Laser Relays leaving phantom connections behind

This commit is contained in:
Ellpeck 2016-11-25 15:33:47 +01:00
parent f7f68e4f16
commit 6955188d7b

View file

@ -75,12 +75,11 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
}
private void queryAndSaveData(){
this.genericInfos.clear();
this.specificInfos.clear();
if(this.connectedRelay != null){
Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.connectedRelay.getPos(), this.worldObj);
if(network != null && (this.oldNetwork != network || this.lastNetworkChangeAmount != network.changeAmount)){
if(network != null){
if(this.oldNetwork != network || this.lastNetworkChangeAmount != network.changeAmount){
this.clearInfos();
this.connectedRelay.getItemHandlersInNetwork(network, this.genericInfos);
if(!this.genericInfos.isEmpty()){
@ -100,6 +99,21 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{
this.oldNetwork = network;
this.lastNetworkChangeAmount = network.changeAmount;
}
return;
}
}
this.clearInfos();
}
private void clearInfos(){
if(!this.genericInfos.isEmpty()){
this.genericInfos.clear();
}
if(!this.specificInfos.isEmpty()){
this.specificInfos.clear();
}
}