Fix 1.14 biome mapping
This commit is contained in:
parent
6b4e7a205f
commit
31dd4dee0f
4 changed files with 25 additions and 5 deletions
|
|
@ -89,6 +89,8 @@ public class BukkitVersionHelperSpigot114 extends BukkitVersionHelperCB {
|
|||
biomelist = new Object[1024];
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
biomelist[i] = IRegistry.BIOME.fromId(i);
|
||||
if (biomelist[i] != null)
|
||||
Log.info("biome[" + i + "]=" + biomelist[i].toString());
|
||||
}
|
||||
}
|
||||
return biomelist;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.bukkit.World;
|
|||
import org.dynmap.DynmapChunk;
|
||||
import org.dynmap.DynmapCore;
|
||||
import org.dynmap.bukkit.helper.AbstractMapChunkCache;
|
||||
import org.dynmap.bukkit.helper.BukkitVersionHelper;
|
||||
import org.dynmap.bukkit.helper.SnapshotCache;
|
||||
import org.dynmap.bukkit.helper.SnapshotCache.SnapshotRec;
|
||||
import org.dynmap.renderer.DynmapBlockState;
|
||||
|
|
@ -40,6 +41,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||
private final Section[] section;
|
||||
private final int[] hmap; // Height map
|
||||
private final int[] biome;
|
||||
private final Object[] biomebase;
|
||||
private final long captureFulltime;
|
||||
private final int sectionCnt;
|
||||
private final long inhabitedTicks;
|
||||
|
|
@ -118,6 +120,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||
this.z = z;
|
||||
this.captureFulltime = captime;
|
||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||
this.sectionCnt = worldheight / 16;
|
||||
/* Allocate arrays indexed by section */
|
||||
this.section = new Section[this.sectionCnt];
|
||||
|
|
@ -213,14 +216,18 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||
}
|
||||
/* Get biome data */
|
||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||
Object[] bbl = BukkitVersionHelper.helper.getBiomeBaseList();
|
||||
if (nbt.hasKey("Biomes")) {
|
||||
int[] bb = nbt.getIntArray("Biomes");
|
||||
if (bb != null) {
|
||||
for (int i = 0; i < bb.length; i++) {
|
||||
int bv = bb[i];
|
||||
this.biome[i] = (bv < 0) ? 0 : bv;
|
||||
if (bv < 0) bv = 0;
|
||||
this.biome[i] = bv;
|
||||
this.biomebase[i] = bbl[bv];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -275,7 +282,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||
|
||||
@Override
|
||||
public Object[] getBiomeBaseFromSnapshot() {
|
||||
return null;
|
||||
return this.biomebase;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue