Fixed crash with External Storage, fixes #1490

This commit is contained in:
raoulvdberge
2017-10-16 21:14:31 +02:00
parent 476de42b31
commit 0614ea6dbf
2 changed files with 8 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
### 1.5.21
- Updated Portuguese (Brazilian) translation (Pinz714)
- Fixed crash with External Storage (raoulvdberge)
### 1.5.20
- Restore MC 1.12.0 compatibility (raoulvdberge)

View File

@@ -88,10 +88,14 @@ public class BlockExternalStorage extends BlockCable {
super.neighborChanged(state, world, pos, block, fromPos);
if (!world.isRemote) {
NetworkNodeExternalStorage externalStorage = ((TileExternalStorage) world.getTileEntity(pos)).getNode();
TileEntity tile = world.getTileEntity(pos);
if (externalStorage.getNetwork() != null) {
externalStorage.updateStorage(externalStorage.getNetwork());
if (tile instanceof TileExternalStorage) {
NetworkNodeExternalStorage externalStorage = ((TileExternalStorage) tile).getNode();
if (externalStorage.getNetwork() != null) {
externalStorage.updateStorage(externalStorage.getNetwork());
}
}
}
}