mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
Fix 1.14 biome mapping
This commit is contained in:
parent
82de1b6899
commit
7f8dcf0eb3
@ -103,6 +103,10 @@ public class BiomeMap {
|
|||||||
new BiomeMap(49, "DEEP_COLD_OCEAN");
|
new BiomeMap(49, "DEEP_COLD_OCEAN");
|
||||||
new BiomeMap(50, "DEEP_FROZEN_OCEAN");
|
new BiomeMap(50, "DEEP_FROZEN_OCEAN");
|
||||||
}
|
}
|
||||||
|
if (HDBlockModels.checkVersionRange(mcver, "1.14.0-")) {
|
||||||
|
new BiomeMap(168, "BAMBOO_JUNGLE");
|
||||||
|
new BiomeMap(169, "BAMBOO_JUNGLE_HILLS");
|
||||||
|
}
|
||||||
loadDone = true;
|
loadDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import org.bukkit.World;
|
|||||||
import org.dynmap.DynmapChunk;
|
import org.dynmap.DynmapChunk;
|
||||||
import org.dynmap.DynmapCore;
|
import org.dynmap.DynmapCore;
|
||||||
import org.dynmap.bukkit.helper.AbstractMapChunkCache;
|
import org.dynmap.bukkit.helper.AbstractMapChunkCache;
|
||||||
|
import org.dynmap.bukkit.helper.BukkitVersionHelper;
|
||||||
import org.dynmap.bukkit.helper.SnapshotCache;
|
import org.dynmap.bukkit.helper.SnapshotCache;
|
||||||
import org.dynmap.bukkit.helper.SnapshotCache.SnapshotRec;
|
import org.dynmap.bukkit.helper.SnapshotCache.SnapshotRec;
|
||||||
import org.dynmap.renderer.DynmapBlockState;
|
import org.dynmap.renderer.DynmapBlockState;
|
||||||
@ -41,6 +42,7 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
|
|||||||
private final Section[] section;
|
private final Section[] section;
|
||||||
private final int[] hmap; // Height map
|
private final int[] hmap; // Height map
|
||||||
private final int[] biome;
|
private final int[] biome;
|
||||||
|
private final Object[] biomebase;
|
||||||
private final long captureFulltime;
|
private final long captureFulltime;
|
||||||
private final int sectionCnt;
|
private final int sectionCnt;
|
||||||
private final long inhabitedTicks;
|
private final long inhabitedTicks;
|
||||||
@ -119,6 +121,7 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
|
|||||||
this.z = z;
|
this.z = z;
|
||||||
this.captureFulltime = captime;
|
this.captureFulltime = captime;
|
||||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||||
|
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||||
this.sectionCnt = worldheight / 16;
|
this.sectionCnt = worldheight / 16;
|
||||||
/* Allocate arrays indexed by section */
|
/* Allocate arrays indexed by section */
|
||||||
this.section = new Section[this.sectionCnt];
|
this.section = new Section[this.sectionCnt];
|
||||||
@ -214,12 +217,16 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
|
|||||||
}
|
}
|
||||||
/* Get biome data */
|
/* Get biome data */
|
||||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||||
|
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||||
|
Object[] bbl = BukkitVersionHelper.helper.getBiomeBaseList();
|
||||||
if (nbt.hasKey("Biomes")) {
|
if (nbt.hasKey("Biomes")) {
|
||||||
int[] bb = nbt.getIntArray("Biomes");
|
int[] bb = nbt.getIntArray("Biomes");
|
||||||
if (bb != null) {
|
if (bb != null) {
|
||||||
for (int i = 0; i < bb.length; i++) {
|
for (int i = 0; i < bb.length; i++) {
|
||||||
int bv = bb[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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,7 +283,7 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] getBiomeBaseFromSnapshot() {
|
public Object[] getBiomeBaseFromSnapshot() {
|
||||||
return null;
|
return this.biomebase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,8 @@ public class BukkitVersionHelperSpigot114 extends BukkitVersionHelperCB {
|
|||||||
biomelist = new Object[1024];
|
biomelist = new Object[1024];
|
||||||
for (int i = 0; i < 1024; i++) {
|
for (int i = 0; i < 1024; i++) {
|
||||||
biomelist[i] = IRegistry.BIOME.fromId(i);
|
biomelist[i] = IRegistry.BIOME.fromId(i);
|
||||||
|
if (biomelist[i] != null)
|
||||||
|
Log.info("biome[" + i + "]=" + biomelist[i].toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return biomelist;
|
return biomelist;
|
||||||
|
@ -11,6 +11,7 @@ import org.bukkit.World;
|
|||||||
import org.dynmap.DynmapChunk;
|
import org.dynmap.DynmapChunk;
|
||||||
import org.dynmap.DynmapCore;
|
import org.dynmap.DynmapCore;
|
||||||
import org.dynmap.bukkit.helper.AbstractMapChunkCache;
|
import org.dynmap.bukkit.helper.AbstractMapChunkCache;
|
||||||
|
import org.dynmap.bukkit.helper.BukkitVersionHelper;
|
||||||
import org.dynmap.bukkit.helper.SnapshotCache;
|
import org.dynmap.bukkit.helper.SnapshotCache;
|
||||||
import org.dynmap.bukkit.helper.SnapshotCache.SnapshotRec;
|
import org.dynmap.bukkit.helper.SnapshotCache.SnapshotRec;
|
||||||
import org.dynmap.renderer.DynmapBlockState;
|
import org.dynmap.renderer.DynmapBlockState;
|
||||||
@ -40,6 +41,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||||||
private final Section[] section;
|
private final Section[] section;
|
||||||
private final int[] hmap; // Height map
|
private final int[] hmap; // Height map
|
||||||
private final int[] biome;
|
private final int[] biome;
|
||||||
|
private final Object[] biomebase;
|
||||||
private final long captureFulltime;
|
private final long captureFulltime;
|
||||||
private final int sectionCnt;
|
private final int sectionCnt;
|
||||||
private final long inhabitedTicks;
|
private final long inhabitedTicks;
|
||||||
@ -118,6 +120,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||||||
this.z = z;
|
this.z = z;
|
||||||
this.captureFulltime = captime;
|
this.captureFulltime = captime;
|
||||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||||
|
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||||
this.sectionCnt = worldheight / 16;
|
this.sectionCnt = worldheight / 16;
|
||||||
/* Allocate arrays indexed by section */
|
/* Allocate arrays indexed by section */
|
||||||
this.section = new Section[this.sectionCnt];
|
this.section = new Section[this.sectionCnt];
|
||||||
@ -213,12 +216,16 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||||||
}
|
}
|
||||||
/* Get biome data */
|
/* Get biome data */
|
||||||
this.biome = new int[COLUMNS_PER_CHUNK];
|
this.biome = new int[COLUMNS_PER_CHUNK];
|
||||||
|
this.biomebase = new Object[COLUMNS_PER_CHUNK];
|
||||||
|
Object[] bbl = BukkitVersionHelper.helper.getBiomeBaseList();
|
||||||
if (nbt.hasKey("Biomes")) {
|
if (nbt.hasKey("Biomes")) {
|
||||||
int[] bb = nbt.getIntArray("Biomes");
|
int[] bb = nbt.getIntArray("Biomes");
|
||||||
if (bb != null) {
|
if (bb != null) {
|
||||||
for (int i = 0; i < bb.length; i++) {
|
for (int i = 0; i < bb.length; i++) {
|
||||||
int bv = bb[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
|
@Override
|
||||||
public Object[] getBiomeBaseFromSnapshot() {
|
public Object[] getBiomeBaseFromSnapshot() {
|
||||||
return null;
|
return this.biomebase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user