Add experimental option to try to migrate old chunks

This commit is contained in:
Mike Primm 2019-06-09 09:59:08 -05:00
parent 881b7dfefd
commit 286a12c4ef
6 changed files with 56 additions and 5 deletions

View file

@ -298,6 +298,12 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
}
if (nbt != null) {
nbt = nbt.getCompound("Level");
if (nbt != null) {
String stat = nbt.getString("Status");
if ((stat == null) || (stat.equals("full") == false)) {
nbt = null;
}
}
}
return nbt;
}
@ -315,7 +321,14 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
if (nbt != null) {
String stat = nbt.getString("Status");
if ((stat == null) || (stat.equals("full") == false)) {
nbt = null;
nbt = null;
if ((stat == null) || stat.equals("") && DynmapCore.migrateChunks()) {
Chunk c = cw.getHandle().getChunkAt(x, z);
if (c != null) {
nbt = fetchLoadedChunkNBT(w, x, z);
cw.getHandle().unloadChunk(c);
}
}
}
}
}