mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-23 18:55:14 +01:00
Fix 1.14 biome shading
This commit is contained in:
parent
8bc03f41b0
commit
a2af65add6
@ -214,21 +214,12 @@ 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];
|
||||||
if (nbt.hasKey("Biomes")) {
|
if (nbt.hasKey("Biomes")) {
|
||||||
byte[] b = nbt.getByteArray("Biomes");
|
int[] bb = nbt.getIntArray("Biomes");
|
||||||
if (b != null) {
|
if (bb != null) {
|
||||||
for (int i = 0; i < b.length; i++) {
|
for (int i = 0; i < bb.length; i++) {
|
||||||
int bv = 255 & b[i];
|
int bv = bb[i];
|
||||||
this.biome[i] = (bv == 255) ? 0 : bv;
|
this.biome[i] = (bv < 0) ? 0 : bv;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else { // Check JEI 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,7 +270,7 @@ public class MapChunkCache114_1 extends AbstractMapChunkCache {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int z) {
|
public Biome getBiome(int x, int z) {
|
||||||
return AbstractMapChunkCache.getBiomeByID(z << 4 | x);
|
return AbstractMapChunkCache.getBiomeByID(biome[z << 4 | x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -214,22 +214,13 @@ 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];
|
||||||
if (nbt.hasKey("Biomes")) {
|
if (nbt.hasKey("Biomes")) {
|
||||||
byte[] b = nbt.getByteArray("Biomes");
|
int[] bb = nbt.getIntArray("Biomes");
|
||||||
if (b != null) {
|
if (bb != null) {
|
||||||
for (int i = 0; i < b.length; i++) {
|
for (int i = 0; i < bb.length; i++) {
|
||||||
int bv = 255 & b[i];
|
int bv = bb[i];
|
||||||
this.biome[i] = (bv == 255) ? 0 : bv;
|
this.biome[i] = (bv < 0) ? 0 : bv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Check JEI 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +270,7 @@ public class MapChunkCache114 extends AbstractMapChunkCache {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int z) {
|
public Biome getBiome(int x, int z) {
|
||||||
return AbstractMapChunkCache.getBiomeByID(z << 4 | x);
|
return AbstractMapChunkCache.getBiomeByID(biome[z << 4 | x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -746,6 +746,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
BiomeMap.loadWellKnownByVersion(mcver);
|
BiomeMap.loadWellKnownByVersion(mcver);
|
||||||
/* Find array of biomes in biomebase */
|
/* Find array of biomes in biomebase */
|
||||||
Object[] biomelist = helper.getBiomeBaseList();
|
Object[] biomelist = helper.getBiomeBaseList();
|
||||||
|
Log.verboseinfo("biomelist length = " + biomelist.length);
|
||||||
/* Loop through list, skipping well known biomes */
|
/* Loop through list, skipping well known biomes */
|
||||||
for(int i = 0; i < biomelist.length; i++) {
|
for(int i = 0; i < biomelist.length; i++) {
|
||||||
Object bb = biomelist[i];
|
Object bb = biomelist[i];
|
||||||
@ -753,6 +754,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
float tmp = helper.getBiomeBaseTemperature(bb);
|
float tmp = helper.getBiomeBaseTemperature(bb);
|
||||||
float hum = helper.getBiomeBaseHumidity(bb);
|
float hum = helper.getBiomeBaseHumidity(bb);
|
||||||
int watermult = helper.getBiomeBaseWaterMult(bb);
|
int watermult = helper.getBiomeBaseWaterMult(bb);
|
||||||
|
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
|
||||||
|
|
||||||
BiomeMap bmap = BiomeMap.byBiomeID(i);
|
BiomeMap bmap = BiomeMap.byBiomeID(i);
|
||||||
if (bmap.isDefault()) {
|
if (bmap.isDefault()) {
|
||||||
String id = helper.getBiomeBaseIDString(bb);
|
String id = helper.getBiomeBaseIDString(bb);
|
||||||
|
Loading…
Reference in New Issue
Block a user