Tie in standard biomes by resource location

This commit is contained in:
Mike Primm 2021-12-04 23:01:13 -06:00
parent 8c51db5608
commit 983a2a4390
4 changed files with 123 additions and 97 deletions

View File

@ -8,33 +8,34 @@ import org.dynmap.hdmap.HDBlockModels;
/* Generic biome mapping */ /* Generic biome mapping */
public class BiomeMap { public class BiomeMap {
public static final int NO_INDEX = -2;
private static BiomeMap[] biome_by_index = new BiomeMap[1025]; private static BiomeMap[] biome_by_index = new BiomeMap[1025];
private static Map<String, BiomeMap> biome_by_rl = new HashMap<String, BiomeMap>(); private static Map<String, BiomeMap> biome_by_rl = new HashMap<String, BiomeMap>();
public static final BiomeMap NULL = new BiomeMap(-1, "NULL", 0.5, 0.5, 0xFFFFFF, 0, 0, null); public static final BiomeMap NULL = new BiomeMap(-1, "NULL", 0.5, 0.5, 0xFFFFFF, 0, 0, null);
public static final BiomeMap OCEAN = new BiomeMap(0, "OCEAN"); public static final BiomeMap OCEAN = new BiomeMap(0, "OCEAN", "minecraft:ocean");
public static final BiomeMap PLAINS = new BiomeMap(1, "PLAINS", 0.8, 0.4); public static final BiomeMap PLAINS = new BiomeMap(1, "PLAINS", 0.8, 0.4, "minecraft:plains");
public static final BiomeMap DESERT = new BiomeMap(2, "DESERT", 2.0, 0.0); public static final BiomeMap DESERT = new BiomeMap(2, "DESERT", 2.0, 0.0, "minecraft:desert");
public static final BiomeMap EXTREME_HILLS = new BiomeMap(3, "EXTREME_HILLS", 0.2, 0.3); public static final BiomeMap EXTREME_HILLS = new BiomeMap(3, "EXTREME_HILLS", 0.2, 0.3, "minecraft:mountains");
public static final BiomeMap FOREST = new BiomeMap(4, "FOREST", 0.7, 0.8); public static final BiomeMap FOREST = new BiomeMap(4, "FOREST", 0.7, 0.8, "minecraft:forest");
public static final BiomeMap TAIGA = new BiomeMap(5, "TAIGA", 0.05, 0.8); public static final BiomeMap TAIGA = new BiomeMap(5, "TAIGA", 0.05, 0.8, "minecraft:taiga");
public static final BiomeMap SWAMPLAND = new BiomeMap(6, "SWAMPLAND", 0.8, 0.9, 0xE0FFAE, 0x4E0E4E, 0x4E0E4E, null); public static final BiomeMap SWAMPLAND = new BiomeMap(6, "SWAMPLAND", 0.8, 0.9, 0xE0FFAE, 0x4E0E4E, 0x4E0E4E, "minecraft:swamp");
public static final BiomeMap RIVER = new BiomeMap(7, "RIVER"); public static final BiomeMap RIVER = new BiomeMap(7, "RIVER", "minecraft:river");
public static final BiomeMap HELL = new BiomeMap(8, "HELL", 2.0, 0.0); public static final BiomeMap HELL = new BiomeMap(8, "HELL", 2.0, 0.0, "minecraft:nether");
public static final BiomeMap SKY = new BiomeMap(9, "SKY"); public static final BiomeMap SKY = new BiomeMap(9, "SKY", "minecraft:the_end");
public static final BiomeMap FROZEN_OCEAN = new BiomeMap(10, "FROZEN_OCEAN", 0.0, 0.5); public static final BiomeMap FROZEN_OCEAN = new BiomeMap(10, "FROZEN_OCEAN", 0.0, 0.5, "minecraft:frozen_ocean");
public static final BiomeMap FROZEN_RIVER = new BiomeMap(11, "FROZEN_RIVER", 0.0, 0.5); public static final BiomeMap FROZEN_RIVER = new BiomeMap(11, "FROZEN_RIVER", 0.0, 0.5, "minecraft:frozen_river");
public static final BiomeMap ICE_PLAINS = new BiomeMap(12, "ICE_PLAINS", 0.0, 0.5); public static final BiomeMap ICE_PLAINS = new BiomeMap(12, "ICE_PLAINS", 0.0, 0.5, "minecraft:snowy_tundra");
public static final BiomeMap ICE_MOUNTAINS = new BiomeMap(13, "ICE_MOUNTAINS", 0.0, 0.5); public static final BiomeMap ICE_MOUNTAINS = new BiomeMap(13, "ICE_MOUNTAINS", 0.0, 0.5, "minecraft:snowy_mountains");
public static final BiomeMap MUSHROOM_ISLAND = new BiomeMap(14, "MUSHROOM_ISLAND", 0.9, 1.0); public static final BiomeMap MUSHROOM_ISLAND = new BiomeMap(14, "MUSHROOM_ISLAND", 0.9, 1.0, "minecraft:mushroom_fields");
public static final BiomeMap MUSHROOM_SHORE = new BiomeMap(15, "MUSHROOM_SHORE", 0.9, 1.0); public static final BiomeMap MUSHROOM_SHORE = new BiomeMap(15, "MUSHROOM_SHORE", 0.9, 1.0, "minecraft:mushroom_field_shore");
public static final BiomeMap BEACH = new BiomeMap(16, "BEACH", 0.8, 0.4); public static final BiomeMap BEACH = new BiomeMap(16, "BEACH", 0.8, 0.4, "minecraft:beach");
public static final BiomeMap DESERT_HILLS = new BiomeMap(17, "DESERT_HILLS", 2.0, 0.0); public static final BiomeMap DESERT_HILLS = new BiomeMap(17, "DESERT_HILLS", 2.0, 0.0, "minecraft:desert_hills");
public static final BiomeMap FOREST_HILLS = new BiomeMap(18, "FOREST_HILLS", 0.7, 0.8); public static final BiomeMap FOREST_HILLS = new BiomeMap(18, "FOREST_HILLS", 0.7, 0.8, "minecraft:wooded_hills");
public static final BiomeMap TAIGA_HILLS = new BiomeMap(19, "TAIGA_HILLS", 0.05, 0.8); public static final BiomeMap TAIGA_HILLS = new BiomeMap(19, "TAIGA_HILLS", 0.05, 0.8, "minecraft:taiga_hills");
public static final BiomeMap SMALL_MOUNTAINS = new BiomeMap(20, "SMALL_MOUNTAINS", 0.2, 0.8); public static final BiomeMap SMALL_MOUNTAINS = new BiomeMap(20, "SMALL_MOUNTAINS", 0.2, 0.8, "minecraft:mountain_edge");
public static final BiomeMap JUNGLE = new BiomeMap(21, "JUNGLE", 1.2, 0.9); public static final BiomeMap JUNGLE = new BiomeMap(21, "JUNGLE", 1.2, 0.9, "minecraft:jungle");
public static final BiomeMap JUNGLE_HILLS = new BiomeMap(22, "JUNGLE_HILLS", 1.2, 0.9); public static final BiomeMap JUNGLE_HILLS = new BiomeMap(22, "JUNGLE_HILLS", 1.2, 0.9, "minecraft:jungle_hills");
public static final int LAST_WELL_KNOWN = 22; public static final int LAST_WELL_KNOWN = 22;
@ -53,76 +54,75 @@ public class BiomeMap {
public static void loadWellKnownByVersion(String mcver) { public static void loadWellKnownByVersion(String mcver) {
if (loadDone) return; if (loadDone) return;
// Don't do this for 1.18 and on
if (HDBlockModels.checkVersionRange(mcver, "1.18.0-")) {
loadDone = true;
return;
}
if (HDBlockModels.checkVersionRange(mcver, "1.7.0-")) { if (HDBlockModels.checkVersionRange(mcver, "1.7.0-")) {
new BiomeMap(23, "JUNGLE_EDGE", 0.95, 0.8); new BiomeMap(23, "JUNGLE_EDGE", 0.95, 0.8, "minecraft:jungle_edge");
new BiomeMap(24, "DEEP_OCEAN"); new BiomeMap(24, "DEEP_OCEAN", "minecraft:deep_ocean");
new BiomeMap(25, "STONE_BEACH", 0.2, 0.3); new BiomeMap(25, "STONE_BEACH", 0.2, 0.3, "minecraft:stone_shore");
new BiomeMap(26, "COLD_BEACH", 0.05, 0.3); new BiomeMap(26, "COLD_BEACH", 0.05, 0.3, "minecraft:snowy_beach");
new BiomeMap(27, "BIRCH_FOREST", 0.6, 0.6); new BiomeMap(27, "BIRCH_FOREST", 0.6, 0.6, "minecraft:birch_forest");
new BiomeMap(28, "BIRCH_FOREST_HILLS", 0.6, 0.6); new BiomeMap(28, "BIRCH_FOREST_HILLS", 0.6, 0.6, "minecraft:birch_forest_hills");
new BiomeMap(29, "ROOFED_FOREST", 0.7, 0.8); new BiomeMap(29, "ROOFED_FOREST", 0.7, 0.8, "minecraft:dark_forest");
new BiomeMap(30, "COLD_TAIGA", -0.5, 0.4); new BiomeMap(30, "COLD_TAIGA", -0.5, 0.4, "minecraft:snowy_taiga");
new BiomeMap(31, "COLD_TAIGA_HILLS", -0.5, 0.4); new BiomeMap(31, "COLD_TAIGA_HILLS", -0.5, 0.4, "minecraft:snowy_taiga_hills");
new BiomeMap(32, "MEGA_TAIGA", 0.3, 0.8); new BiomeMap(32, "MEGA_TAIGA", 0.3, 0.8, "minecraft:giant_tree_taiga");
new BiomeMap(33, "MEGA_TAIGA_HILLS", 0.3, 0.8); new BiomeMap(33, "MEGA_TAIGA_HILLS", 0.3, 0.8, "minecraft:giant_tree_taiga_hills");
new BiomeMap(34, "EXTREME_HILLS_PLUS", 0.2, 0.3); new BiomeMap(34, "EXTREME_HILLS_PLUS", 0.2, 0.3, "minecraft:wooded_mountains");
new BiomeMap(35, "SAVANNA", 1.2, 0.0); new BiomeMap(35, "SAVANNA", 1.2, 0.0, "minecraft:savanna");
new BiomeMap(36, "SAVANNA_PLATEAU", 1.0, 0.0); new BiomeMap(36, "SAVANNA_PLATEAU", 1.0, 0.0, "minecraft:savanna_plateau");
new BiomeMap(37, "MESA", 2.0, 0.0); new BiomeMap(37, "MESA", 2.0, 0.0, "minecraft:badlands");
new BiomeMap(38, "MESA_PLATEAU_FOREST", 2.0, 0.0); new BiomeMap(38, "MESA_PLATEAU_FOREST", 2.0, 0.0, "minecraft:wooded_badlands_plateau");
new BiomeMap(39, "MESA_PLATEAU", 2.0, 0.0); new BiomeMap(39, "MESA_PLATEAU", 2.0, 0.0, "minecraft:badlands_plateau");
new BiomeMap(129, "SUNFLOWER_PLAINS", 0.8, 0.4); new BiomeMap(129, "SUNFLOWER_PLAINS", 0.8, 0.4, "minecraft:sunflower_plains");
new BiomeMap(130, "DESERT_MOUNTAINS", 2.0, 0.0); new BiomeMap(130, "DESERT_MOUNTAINS", 2.0, 0.0, "minecraft:desert_lakes");
new BiomeMap(131, "EXTREME_HILLS_MOUNTAINS", 0.2, 0.3); new BiomeMap(131, "EXTREME_HILLS_MOUNTAINS", 0.2, 0.3, "minecraft:gravelly_mountains");
new BiomeMap(132, "FLOWER_FOREST", 0.7, 0.8); new BiomeMap(132, "FLOWER_FOREST", 0.7, 0.8, "minecraft:flower_forest");
new BiomeMap(133, "TAIGA_MOUNTAINS", 0.05, 0.8); new BiomeMap(133, "TAIGA_MOUNTAINS", 0.05, 0.8, "minecraft:taiga_mountains");
new BiomeMap(134, "SWAMPLAND_MOUNTAINS", 0.8, 0.9, 0xE0FFAE, 0x4E0E4E, 0x4E0E4E, null); new BiomeMap(134, "SWAMPLAND_MOUNTAINS", 0.8, 0.9, 0xE0FFAE, 0x4E0E4E, 0x4E0E4E, "minecraft:swamp_hills");
new BiomeMap(140, "ICE_PLAINS_SPIKES", 0.0, 0.5); new BiomeMap(140, "ICE_PLAINS_SPIKES", 0.0, 0.5, "minecraft:ice_spikes");
new BiomeMap(149, "JUNGLE_MOUNTAINS", 1.2, 0.9); new BiomeMap(149, "JUNGLE_MOUNTAINS", 1.2, 0.9, "minecraft:modified_jungle");
new BiomeMap(151, "JUNGLE_EDGE_MOUNTAINS", 0.95, 0.8); new BiomeMap(151, "JUNGLE_EDGE_MOUNTAINS", 0.95, 0.8, "minecraft:modified_jungle_edge");
new BiomeMap(155, "BIRCH_FOREST_MOUNTAINS", 0.6, 0.6); new BiomeMap(155, "BIRCH_FOREST_MOUNTAINS", 0.6, 0.6, "minecraft:tall_birch_forest");
new BiomeMap(156, "BIRCH_FOREST_HILLS_MOUNTAINS", 0.6, 0.6); new BiomeMap(156, "BIRCH_FOREST_HILLS_MOUNTAINS", 0.6, 0.6, "minecraft:tall_birch_hills");
new BiomeMap(157, "ROOFED_FOREST_MOUNTAINS", 0.7, 0.8); new BiomeMap(157, "ROOFED_FOREST_MOUNTAINS", 0.7, 0.8, "minecraft:dark_forest_hills");
new BiomeMap(158, "COLD_TAIGA_MOUNTAINS", -0.5, 0.4); new BiomeMap(158, "COLD_TAIGA_MOUNTAINS", -0.5, 0.4, "minecraft:snowy_taiga_mountains");
new BiomeMap(160, "MEGA_SPRUCE_TAIGA", 0.25, 0.8); new BiomeMap(160, "MEGA_SPRUCE_TAIGA", 0.25, 0.8, "minecraft:giant_spruce_taiga");
new BiomeMap(161, "MEGA_SPRUCE_TAIGA_HILLS", 0.3, 0.8); new BiomeMap(161, "MEGA_SPRUCE_TAIGA_HILLS", 0.3, 0.8, "minecraft:giant_spruce_taiga_hills");
new BiomeMap(162, "EXTREME_HILLS_PLUS_MOUNTAINS", 0.2, 0.3); new BiomeMap(162, "EXTREME_HILLS_PLUS_MOUNTAINS", 0.2, 0.3, "minecraft:modified_gravelly_mountains");
new BiomeMap(163, "SAVANNA_MOUNTAINS", 1.2, 0.0); new BiomeMap(163, "SAVANNA_MOUNTAINS", 1.2, 0.0, "minecraft:shattered_savanna");
new BiomeMap(164, "SAVANNA_PLATEAU_MOUNTAINS", 1.0, 0.0); new BiomeMap(164, "SAVANNA_PLATEAU_MOUNTAINS", 1.0, 0.0, "minecraft:shattered_savanna_plateau");
new BiomeMap(165, "MESA_BRYCE", 2.0, 0.0); new BiomeMap(165, "MESA_BRYCE", 2.0, 0.0, "minecraft:eroded_badlands");
new BiomeMap(166, "MESA_PLATEAU_FOREST_MOUNTAINS", 2.0, 0.0); new BiomeMap(166, "MESA_PLATEAU_FOREST_MOUNTAINS", 2.0, 0.0, "minecraft:modified_wooded_badlands_plateau");
new BiomeMap(167, "MESA_PLATEAU_MOUNTAINS", 2.0, 0.0); new BiomeMap(167, "MESA_PLATEAU_MOUNTAINS", 2.0, 0.0, "minecraft:modified_badlands_plateau");
} }
if (HDBlockModels.checkVersionRange(mcver, "1.9.0-")) { if (HDBlockModels.checkVersionRange(mcver, "1.9.0-")) {
new BiomeMap(127, "THE_VOID"); new BiomeMap(127, "THE_VOID", "minecraft:the_void");
} }
if (HDBlockModels.checkVersionRange(mcver, "1.13.0-")) { if (HDBlockModels.checkVersionRange(mcver, "1.13.0-")) {
new BiomeMap(40, "SMALL_END_ISLANDS"); new BiomeMap(40, "SMALL_END_ISLANDS", "minecraft:small_end_islands");
new BiomeMap(41, "END_MIDLANDS"); new BiomeMap(41, "END_MIDLANDS", "minecraft:end_midlands");
new BiomeMap(42, "END_HIGHLANDS"); new BiomeMap(42, "END_HIGHLANDS", "minecraft:end_highlands");
new BiomeMap(43, "END_BARRENS"); new BiomeMap(43, "END_BARRENS", "minecraft:end_barrens");
new BiomeMap(44, "WARM_OCEAN"); new BiomeMap(44, "WARM_OCEAN", "minecraft:warm_ocean");
new BiomeMap(45, "LUKEWARM_OCEAN"); new BiomeMap(45, "LUKEWARM_OCEAN", "minecraft:lukewarm_ocean");
new BiomeMap(46, "COLD_OCEAN"); new BiomeMap(46, "COLD_OCEAN", "minecraft:cold_ocean");
new BiomeMap(47, "DEEP_WARM_OCEAN"); new BiomeMap(47, "DEEP_WARM_OCEAN", "minecraft:deep_warm_ocean");
new BiomeMap(48, "DEEP_LUKEWARM_OCEAN"); new BiomeMap(48, "DEEP_LUKEWARM_OCEAN", "minecraft:deep_lukewarm_ocean");
new BiomeMap(49, "DEEP_COLD_OCEAN"); new BiomeMap(49, "DEEP_COLD_OCEAN", "minecraft:deep_cold_ocean");
new BiomeMap(50, "DEEP_FROZEN_OCEAN"); new BiomeMap(50, "DEEP_FROZEN_OCEAN", "minecraft:deep_frozen_ocean");
} }
if (HDBlockModels.checkVersionRange(mcver, "1.14.0-")) { if (HDBlockModels.checkVersionRange(mcver, "1.14.0-")) {
new BiomeMap(168, "BAMBOO_JUNGLE"); new BiomeMap(168, "BAMBOO_JUNGLE", "minecraft:bamboo_jungle");
new BiomeMap(169, "BAMBOO_JUNGLE_HILLS"); new BiomeMap(169, "BAMBOO_JUNGLE_HILLS", "minecraft:bamboo_jungle_hills");
} }
if (HDBlockModels.checkVersionRange(mcver, "1.16.0-")) { if (HDBlockModels.checkVersionRange(mcver, "1.16.0-")) {
new BiomeMap(170, "SOUL_SAND_VALLEY"); new BiomeMap(170, "SOUL_SAND_VALLEY", "minecraft:soul_sand_valley");
new BiomeMap(171, "CRIMSON_FOREST"); new BiomeMap(171, "CRIMSON_FOREST", "minecraft:crimson_forest");
new BiomeMap(172, "WARPED_FOREST"); new BiomeMap(172, "WARPED_FOREST", "minecraft:warped_forest");
new BiomeMap(173, "BASALT_DELTAS"); new BiomeMap(173, "BASALT_DELTAS", "minecraft:basalt_deltas");
}
if (HDBlockModels.checkVersionRange(mcver, "1.17.0-")) {
new BiomeMap(174, "DRIPSTONE_CAVES", "minecraft:dripstone_caves");
new BiomeMap(175, "LUSH_CAVES", "minecraft:lush_caves");
} }
loadDone = true; loadDone = true;
} }
@ -155,13 +155,13 @@ public class BiomeMap {
// Handle null biome // Handle null biome
if (id == null) { id = "biome_" + idx; } if (id == null) { id = "biome_" + idx; }
id = id.toUpperCase().replace(' ', '_'); id = id.toUpperCase().replace(' ', '_');
if(isUniqueID(id) == false) { if (isUniqueID(id) == false) {
id = id + "_" + idx; id = id + "_" + idx;
} }
this.id = id; this.id = id;
idx++; /* Insert one after ID value - null is zero index */ idx++; /* Insert one after ID value - null is zero index */
this.index = idx; this.index = idx;
if(idx >= 0) { if (idx >= 0) {
biome_by_index[idx] = this; biome_by_index[idx] = this;
} }
this.resourcelocation = rl; this.resourcelocation = rl;
@ -172,6 +172,9 @@ public class BiomeMap {
public BiomeMap(int idx, String id) { public BiomeMap(int idx, String id) {
this(idx, id, 0.5, 0.5, 0xFFFFFF, 0, 0, null); this(idx, id, 0.5, 0.5, 0xFFFFFF, 0, 0, null);
} }
public BiomeMap(int idx, String id, String rl) {
this(idx, id, 0.5, 0.5, 0xFFFFFF, 0, 0, rl);
}
public BiomeMap(int idx, String id, double tmp, double rain) { public BiomeMap(int idx, String id, double tmp, double rain) {
this(idx, id, tmp, rain, 0xFFFFFF, 0, 0, null); this(idx, id, tmp, rain, 0xFFFFFF, 0, 0, null);
@ -180,7 +183,11 @@ public class BiomeMap {
public BiomeMap(int idx, String id, double tmp, double rain, String rl) { public BiomeMap(int idx, String id, double tmp, double rain, String rl) {
this(idx, id, tmp, rain, 0xFFFFFF, 0, 0, rl); this(idx, id, tmp, rain, 0xFFFFFF, 0, 0, rl);
} }
public BiomeMap(String id, double tmp, double rain, String rl) {
this(NO_INDEX, id, tmp, rain, 0xFFFFFF, 0, 0, rl); // No index
}
private final int biomeLookup(int width) { private final int biomeLookup(int width) {
int w = width-1; int w = width-1;
int t = (int)((1.0-tmp)*w); int t = (int)((1.0-tmp)*w);

View File

@ -381,12 +381,19 @@ public class DynmapPlugin {
int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor(); int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor();
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult)); Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.byBiomeID(i); BiomeMap bmap = BiomeMap.NULL;
if ((rl != null) || bmap.isDefault()) { if (rl != null) { // If resource location, lookup by this
bmap = new BiomeMap(i, id, tmp, hum, rl); bmap = BiomeMap.byBiomeResourceLocation(rl);
}
if (bmap == BiomeMap.NULL) {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault()) {
bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")"); Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++; cnt++;
} else { }
else {
bmap.setTemperature(tmp); bmap.setTemperature(tmp);
bmap.setRainfall(hum); bmap.setRainfall(hum);
} }

View File

@ -1396,9 +1396,15 @@ public class DynmapPlugin
int watermult = bb.getWaterColor(); int watermult = bb.getWaterColor();
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult)); Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.byBiomeID(i); BiomeMap bmap = BiomeMap.NULL;
if ((rl != null) || bmap.isDefault()) { if (rl != null) { // If resource location, lookup by this
bmap = new BiomeMap(i, id, tmp, hum, rl); bmap = BiomeMap.byBiomeResourceLocation(rl);
}
if (bmap == BiomeMap.NULL) {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault()) { // If matched default, replace with new one
bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")"); Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++; cnt++;
} }

View File

@ -824,13 +824,19 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
int watermult = helper.getBiomeBaseWaterMult(bb); int watermult = helper.getBiomeBaseWaterMult(bb);
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult)); Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.byBiomeID(i); BiomeMap bmap = BiomeMap.NULL;
if ((rl != null) || bmap.isDefault()) { if (rl != null) { // If resource location, lookup by this
bmap = BiomeMap.byBiomeResourceLocation(rl);
}
if (bmap == BiomeMap.NULL) {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault()) {
String id = helper.getBiomeBaseIDString(bb); String id = helper.getBiomeBaseIDString(bb);
if(id == null) { if(id == null) {
id = "BIOME_" + i; id = "BIOME_" + i;
} }
bmap = new BiomeMap(i, id, tmp, hum, rl); bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ") rl=" + rl); Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ") rl=" + rl);
cnt++; cnt++;
} }