More fixes

This commit is contained in:
Raoul Van den Berge
2016-06-24 18:47:00 +02:00
parent e3e948ee52
commit f10b2b9be7
3 changed files with 23 additions and 9 deletions

View File

@@ -233,4 +233,14 @@ public abstract class TileSlave extends TileBase implements INetworkSlave, ISync
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
return capability == RefinedStorageCapabilities.NETWORK_SLAVE_CAPABILITY || super.hasCapability(capability, facing);
}
@Override
public int hashCode() {
return pos.hashCode();
}
@Override
public boolean equals(Object other) {
return other instanceof TileSlave && ((TileSlave) other).getPos().equals(pos);
}
}

View File

@@ -152,7 +152,8 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
}
}
} else if (!slaves.isEmpty()) {
disconnectAll();
disconnectSlaves();
updateSlaves();
}
@@ -207,6 +208,14 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
slavesToRemove.add(slave);
}
public void disconnectSlaves() {
for (INetworkSlave slave : getSlaves()) {
slave.disconnect(worldObj);
}
slaves.clear();
}
@Override
public IGridHandler getGridHandler() {
return gridHandler;
@@ -217,12 +226,9 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
return wirelessGridHandler;
}
public void disconnectAll() {
for (INetworkSlave slave : getSlaves()) {
slave.disconnect(worldObj);
}
slaves.clear();
@Override
public void onChunkUnload() {
disconnectSlaves();
}
@Override

View File

@@ -55,8 +55,6 @@ misc.refinedstorage:clear=Clear
misc.refinedstorage:cancel_all=Cancel All
misc.refinedstorage:priority=Priority
misc.refinedstorage:no_network=This Controller isn't associated with any storage network. If you just upgraded to 0.7.17, this is absolutely normal. In that case, a simple one-time break and replace should fix the issue.
sidebutton.refinedstorage:compare.1=Compare Damage
sidebutton.refinedstorage:compare.2=Compare NBT