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 03bc80b0e3
commit f49daa2d1d
6 changed files with 56 additions and 5 deletions

View file

@ -297,6 +297,12 @@ public class MapChunkCache114 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;
}
@ -313,9 +319,16 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
nbt = nbt.getCompound("Level");
if (nbt != null) {
String stat = nbt.getString("Status");
if ((stat == null) || (stat.equals("full") == false)) {
nbt = null;
}
if ((stat == null) || (stat.equals("full") == false)) {
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);
}
}
}
}
}
return nbt;