use of org.dynmap.common.BiomeMap in project dynmap by webbukkit.
the class DynmapPlugin method loadExtraBiomes.
public void loadExtraBiomes(String mcver) {
int cnt = 0;
BiomeMap.loadWellKnownByVersion(mcver);
/* Find array of biomes in biomebase */
Object[] biomelist = helper.getBiomeBaseList();
/* Loop through list, skipping well known biomes */
for (int i = 0; i < biomelist.length; i++) {
Object bb = biomelist[i];
if (bb != null) {
String rl = helper.getBiomeBaseResourceLocsation(bb);
float tmp = helper.getBiomeBaseTemperature(bb);
float hum = helper.getBiomeBaseHumidity(bb);
int watermult = helper.getBiomeBaseWaterMult(bb);
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.NULL;
if (rl != null) {
// If resource location, lookup by this
bmap = BiomeMap.byBiomeResourceLocation(rl);
} else {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault() || (bmap == BiomeMap.NULL)) {
String id = helper.getBiomeBaseIDString(bb);
if (id == null) {
id = "BIOME_" + i;
}
bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ") rl=" + rl);
// Log.info(String.format("rl=%s, bmap=%s", rl, bmap));
cnt++;
} else {
bmap.setTemperature(tmp);
bmap.setRainfall(hum);
}
if (watermult != -1) {
bmap.setWaterColorMultiplier(watermult);
Log.verboseinfo("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult));
}
}
}
if (cnt > 0) {
Log.info("Added " + cnt + " custom biome mappings");
}
}
use of org.dynmap.common.BiomeMap in project dynmap by webbukkit.
the class DynmapExpCommand method loadExtraBiomes.
public void loadExtraBiomes(String mcver) {
int cnt = 0;
BiomeMap.loadWellKnownByVersion(mcver);
Biome[] list = getBiomeList();
for (int i = 0; i < list.length; i++) {
Biome bb = list[i];
if (bb != null) {
String id = bb.biomeName;
float tmp = bb.getDefaultTemperature(), hum = bb.getRainfall();
BiomeMap bmap = BiomeMap.byBiomeID(i);
if (bmap.isDefault()) {
BiomeMap m = new BiomeMap(i, id, tmp, hum);
Log.verboseinfo("Add custom biome [" + m.toString() + "] (" + i + ")");
cnt++;
} else {
bmap.setTemperature(tmp);
bmap.setRainfall(hum);
}
}
}
if (cnt > 0)
Log.info("Added " + cnt + " custom biome mappings");
}
use of org.dynmap.common.BiomeMap in project dynmap by webbukkit.
the class DynmapExpCommand method loadExtraBiomes.
public void loadExtraBiomes(String mcver) {
int cnt = 0;
BiomeMap.loadWellKnownByVersion(mcver);
Biome[] list = getBiomeList();
for (int i = 0; i < list.length; i++) {
Biome bb = list[i];
if (bb != null) {
String id = bb.toString();
float tmp = bb.getTemperature(), hum = bb.getDownfall();
int watermult = bb.getAmbience().waterColor;
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.byBiomeID(i);
if (bmap.isDefault()) {
bmap = new BiomeMap(i, id, tmp, hum);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++;
} else {
bmap.setTemperature(tmp);
bmap.setRainfall(hum);
}
if (watermult != -1) {
bmap.setWaterColorMultiplier(watermult);
Log.verboseinfo("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult));
}
}
}
if (cnt > 0)
Log.info("Added " + cnt + " custom biome mappings");
}
use of org.dynmap.common.BiomeMap in project dynmap by webbukkit.
the class DynmapPlugin method loadExtraBiomes.
public void loadExtraBiomes(String mcver) {
int cnt = 0;
BiomeMap.loadWellKnownByVersion(mcver);
Registry<Biome> biomeRegistry = getFabricServer().getBiomeRegistry();
Biome[] list = getFabricServer().getBiomeList(biomeRegistry);
for (int i = 0; i < list.length; i++) {
Biome bb = list[i];
if (bb != null) {
String id = biomeRegistry.getId(bb).getPath();
String rl = biomeRegistry.getId(bb).toString();
float tmp = bb.getTemperature(), hum = bb.getDownfall();
int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor();
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.NULL;
if (rl != null) {
// If resource location, lookup by this
bmap = BiomeMap.byBiomeResourceLocation(rl);
} else {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault() || (bmap == BiomeMap.NULL)) {
bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++;
} else {
bmap.setTemperature(tmp);
bmap.setRainfall(hum);
}
if (watermult != -1) {
bmap.setWaterColorMultiplier(watermult);
Log.verboseinfo("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult));
}
}
}
if (cnt > 0)
Log.info("Added " + cnt + " custom biome mappings");
}
use of org.dynmap.common.BiomeMap in project dynmap by webbukkit.
the class DynmapPlugin method loadExtraBiomes.
public void loadExtraBiomes(String mcver) {
int cnt = 0;
BiomeMap.loadWellKnownByVersion(mcver);
Registry<Biome> biomeRegistry = getFabricServer().getBiomeRegistry();
Biome[] list = getFabricServer().getBiomeList(biomeRegistry);
for (int i = 0; i < list.length; i++) {
Biome bb = list[i];
if (bb != null) {
String id = biomeRegistry.getId(bb).getPath();
String rl = biomeRegistry.getId(bb).toString();
float tmp = bb.getTemperature(), hum = bb.getDownfall();
int watermult = ((BiomeEffectsAccessor) bb.getEffects()).getWaterColor();
Log.verboseinfo("biome[" + i + "]: hum=" + hum + ", tmp=" + tmp + ", mult=" + Integer.toHexString(watermult));
BiomeMap bmap = BiomeMap.NULL;
if (rl != null) {
// If resource location, lookup by this
bmap = BiomeMap.byBiomeResourceLocation(rl);
} else {
bmap = BiomeMap.byBiomeID(i);
}
if (bmap.isDefault() || (bmap == BiomeMap.NULL)) {
bmap = new BiomeMap((rl != null) ? BiomeMap.NO_INDEX : i, id, tmp, hum, rl);
Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++;
} else {
bmap.setTemperature(tmp);
bmap.setRainfall(hum);
}
if (watermult != -1) {
bmap.setWaterColorMultiplier(watermult);
Log.verboseinfo("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult));
}
}
}
if (cnt > 0)
Log.info("Added " + cnt + " custom biome mappings");
}
Aggregations