mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
fabric-1.18: update to 1.18 chunk format
This commit is contained in:
parent
038f9c7085
commit
b82095fcb6
@ -165,7 +165,7 @@ public class ChunkSnapshot {
|
||||
sectcnt++;
|
||||
}
|
||||
/* Get sections */
|
||||
NbtList sect = nbt.getList("Sections", 10);
|
||||
NbtList sect = nbt.getList("sections", 10);
|
||||
for (int i = 0; i < sect.size(); i++) {
|
||||
NbtCompound sec = sect.getCompound(i);
|
||||
int secnum = sec.getByte("Y");
|
||||
@ -186,10 +186,11 @@ public class ChunkSnapshot {
|
||||
sections.set(secnum + sectoff, cursect);
|
||||
DynmapBlockState[] states = cursect.states;
|
||||
DynmapBlockState[] palette = null;
|
||||
// If we've got palette and block states list, process non-empty section
|
||||
if (sec.contains("Palette", 9) && sec.contains("BlockStates", 12)) {
|
||||
NbtList plist = sec.getList("Palette", 10);
|
||||
long[] statelist = sec.getLongArray("BlockStates");
|
||||
NbtCompound block_states = sec.getCompound("block_states");
|
||||
// If we've block state data, process non-empty section
|
||||
if (block_states.contains("data", 12)) {
|
||||
long[] statelist = block_states.getLongArray("data");
|
||||
NbtList plist = block_states.getList("palette", 10);
|
||||
palette = new DynmapBlockState[plist.size()];
|
||||
for (int pi = 0; pi < plist.size(); pi++) {
|
||||
NbtCompound tc = plist.getCompound(pi);
|
||||
@ -247,6 +248,7 @@ public class ChunkSnapshot {
|
||||
}
|
||||
}
|
||||
/* Get biome data */
|
||||
// TODO: Update to new 1.18 format (3D biomes, sectioned):
|
||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||
if (nbt.contains("Biomes")) {
|
||||
int[] bb = nbt.getIntArray("Biomes");
|
||||
|
@ -1099,7 +1099,6 @@ public class FabricMapChunkCache extends MapChunkCache {
|
||||
Log.severe("ChunkSerializer.serialize threw a NullPointerException", e);
|
||||
continue;
|
||||
}
|
||||
if (nbt != null) nbt = nbt.getCompound("Level");
|
||||
try {
|
||||
SnapshotCache.SnapshotRec ssr = prepChunkSnapshot(chunk, nbt);
|
||||
ss = ssr.ss;
|
||||
|
Loading…
Reference in New Issue
Block a user