Fixed crash when node data mismatches between world and dat file, fixes #1326 and #1307

This commit is contained in:
raoulvdberge
2017-06-24 20:06:20 +02:00
parent d4ea3361ce
commit f4ada773a7
2 changed files with 11 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
### 1.5.4
- Fixed External Storage crashing (raoulvdberge)
- Fixed crash when node data mismatches between world and dat file (raoulvdberge)
### 1.5.3
- Updated Forge to 2359 (raoulvdberge)

View File

@@ -112,7 +112,16 @@ public abstract class TileNode<N extends NetworkNode> extends TileBase implement
doLegacyCheck(node);
}
return (N) node;
N castedNode;
try {
castedNode = (N) node;
} catch (ClassCastException e) {
manager.setNode(pos, castedNode = createNode(world, pos));
manager.markForSaving();
}
return castedNode;
}
private void doLegacyCheck(NetworkNode node) {