biome rework test

This commit is contained in:
Sen 2025-07-22 23:59:00 +02:00
parent 0f128c1b1b
commit b524eeeaa3
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
28 changed files with 454 additions and 1108 deletions

View file

@ -1,149 +1,27 @@
package common.biome;
import common.log.Log;
public class Biome {
public static final Biome NONE = new Biome(0.0f, 50.0f).setSea();
public static final Biome PLAIN = new Biome(12.0f, 40.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome DESERT = new Biome(60.0f, 0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome HILLS = new Biome(-12.0f, 30.0f).setScaling(Scaling.HILLS_LARGE);
public static final Biome FOREST = new Biome(8.0f, 80.0f);
public static final Biome TAIGA = new Biome(-10.0f, 80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome SWAMP = new Biome(12.0f, 90.0f).setScaling(Scaling.SEA_POND).disableBeach();
public static final Biome RIVER = new Biome(0.0f, 50.0f).setScaling(Scaling.SEA_SHALLOW).disableBeach();
public static final Biome ICE_SEA = new Biome(-20.0f, 50.0f).enableColdBeach().setScaling(Scaling.SEA_MEDIUM).setSea().disableBeach();
public static final Biome ICE_RIVER = new Biome(-20.0f, 50.0f).enableColdBeach().setScaling(Scaling.SEA_SHALLOW).disableBeach();
public static final Biome ICE = new Biome(-20.0f, 50.0f).enableColdBeach().setScaling(Scaling.PLAINS_LOW);
public static final Biome ICE_HILLS = new Biome(-20.0f, 50.0f).enableColdBeach().setScaling(Scaling.HILLS_LOW);
public static final Biome BEACH = new Biome(12.0f, 40.0f).setScaling(Scaling.SEA_SHORE);
public static final Biome DESERT_HILLS = new Biome(60.0f, 0.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome FOREST_HILLS = new Biome(8.0f, 80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome TAIGA_HILLS = new Biome(-10.0f, 80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome HILLS_EDGE = new Biome(-12.0f, 30.0f).setScaling(Scaling.HILLS_MEDIUM);
public static final Biome TROPIC = new Biome(18.0f, 90.0f).setTropical();
public static final Biome TROPIC_HILLS = new Biome(18.0f, 90.0f).setTropical().setScaling(Scaling.HILLS_LOW);
public static final Biome TROPIC_EDGE = new Biome(18.0f, 80.0f).setTropical();
public static final Biome SEA = new Biome(0.0f, 50.0f).setScaling(Scaling.SEA_MEDIUM).setSea().disableBeach();
public static final Biome STONE_BEACH = new Biome(-12.0f, 30.0f).setScaling(Scaling.SEA_VARYING);
public static final Biome ICE_BEACH = new Biome(-18.0f, 30.0f).setScaling(Scaling.SEA_SHORE).enableColdBeach();
public static final Biome BIRCH_FOREST = new Biome(4.0f, 60.0f);
public static final Biome BIRCH_HILLS = new Biome(4.0f, 60.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome DARK_FOREST = new Biome(8.0f, 80.0f);
public static final Biome ICE_TAIGA = new Biome(-40.0f, 40.0f).enableColdBeach().setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome ICE_TAIGA_HILLS = new Biome(-40.0f, 40.0f).enableColdBeach().setScaling(Scaling.HILLS_LOW);
public static final Biome LARGE_TAIGA = new Biome(-8.0f, 80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome LARGE_TAIGA_HILLS = new Biome(-8.0f, 80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome LARGE_HILLS = new Biome(-12.0f, 30.0f).setScaling(Scaling.HILLS_LARGE);
public static final Biome SAVANNA = new Biome(28.0f, 0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome SAVANNA_PLATEAU = new Biome(20.0f, 0.0f).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome DESERT_MOD = DESERT.mutate(60.0f, 0.0f);
public static final Biome HILLS_MOD = HILLS.mutate(new Biome(-12.0f, 30.0f).setScaling(HILLS.depth, HILLS.scale));
public static final Biome FLOWER_FOREST = FOREST.mutate(new Biome(8.0f, 80.0f).setScaling(FOREST.depth, FOREST.scale + 0.2F));
public static final Biome TAIGA_MOD = TAIGA.mutate(-10.0f, 80.0f);
public static final Biome SWAMP_MOD = SWAMP.mutate(12.0f, 90.0f);
public static final Biome ICE_SPIKES = ICE.mutate(new Biome(-20.0f, 50.0f).enableColdBeach().setScaling(ICE.depth + 0.3F, ICE.scale + 0.4F));
public static final Biome TROPIC_MOD = TROPIC.mutate(18.0f, 90.0f);
public static final Biome TROPIC_EDGE_MOD = TROPIC_EDGE.mutate(18.0f, 80.0f);
public static final Biome BIRCH_FOREST_MOD = BIRCH_FOREST.mutate(4.0f, 60.0f);
public static final Biome BIRCH_HILLS_MOD = BIRCH_HILLS.mutate(4.0f, 60.0f);
public static final Biome DARK_FOREST_MOD = DARK_FOREST.mutate(8.0f, 80.0f);
public static final Biome ICE_TAIGA_MOD = ICE_TAIGA.mutate(-40.0f, 40.0f);
public static final Biome SPRUCE_TAIGA = LARGE_TAIGA.mutate((new Biome(-10.0f, 80.0f)).setScaling(LARGE_TAIGA.depth, LARGE_TAIGA.scale));
public static final Biome REDWOOD_TAIGA = LARGE_TAIGA.mutate(-10.0f, 80.0f);
public static final Biome LARGE_HILLS_MOD = LARGE_HILLS.mutate(new Biome(-12.0f, 30.0f).setScaling(LARGE_HILLS.depth, LARGE_HILLS.scale));
public static final Biome SAVANNA_MOD = SAVANNA.mutate(new Biome(24.0f, 0.0f, SAVANNA).setScaling(SAVANNA.depth * 0.5F + 0.3F, SAVANNA.scale * 0.5F + 1.2F));
public static final Biome SAVANNA_PLATEAU_MOD = SAVANNA_PLATEAU.mutate(new Biome(20.0f, 0.0f, SAVANNA_PLATEAU).setScaling(SAVANNA_PLATEAU.depth * 0.5F + 0.3F, SAVANNA_PLATEAU.scale * 0.5F + 1.2F));
public int id;
public final class Biome {
public final float temperature;
public final float humidity;
public final float depth;
public final float scale;
public final float factor;
protected Biome baseBiome;
public Biome mutated = null;
public float depth = Scaling.VARYING_LOW.depth;
public float scale = Scaling.VARYING_LOW.scale;
public float factor;
public boolean allowColdBeach = false;
public boolean disallowBeach = false;
public boolean tropical = false;
public Temperature category;
public int id;
public Biome(float temperature, float humidity) {
BIOMES[id] = this;
this.id = id;
public Biome(float temperature, float humidity, float depth, float scale) {
this.temperature = temperature;
this.humidity = humidity;
this.category = temperature < -12.0f ? Temperature.COLD : (temperature < 20.0f ? Temperature.MEDIUM : Temperature.WARM);
this.factor = Math.min(humidity * 0.01f * ((temperature + 14.0f) / 40.0f + 0.15f), 1.0f);
}
public Biome(float temperature, float humidity, Biome biome)
{
this(temperature, humidity);
this.baseBiome = biome;
this.allowColdBeach = biome.allowColdBeach;
this.tropical = biome.tropical;
this.disallowBeach = biome.disallowBeach;
this.depth = biome.depth + 0.1F;
this.scale = biome.scale + 0.2F;
this.category = biome.category;
this.factor = biome.factor;
}
protected final Biome setScaling(Scaling scaling)
{
return this.setScaling(scaling.depth, scaling.scale);
}
protected final Biome setScaling(float depth, float scale)
{
this.depth = depth;
this.scale = scale;
return this;
}
protected Biome enableColdBeach()
{
this.allowColdBeach = true;
return this;
}
protected Biome disableBeach()
{
this.disallowBeach = true;
return this;
}
protected Biome setTropical()
{
this.tropical = true;
return this;
}
protected Biome setSea()
{
this.category = Temperature.SEA;
return this;
}
private Biome mutate(Biome mutated)
{
return this.mutated = mutated;
}
private Biome mutate(float temperature, float humidity)
{
return this.mutated = new Biome(temperature, humidity, this);
this.factor = Math.min(humidity * 0.01f * ((temperature + 14.0f) / 40.0f + 0.15f), 1.0f);
}
public Class <? extends Biome > getBiomeClass()
{
return this.baseBiome != null ? this.baseBiome.getBiomeClass() : this.getClass();
public Biome(float temperature, float humidity, Scaling scaling) {
this(temperature, humidity, scaling.depth, scaling.scale);
}
public boolean isEqualTo(Biome biome)
{
return this.baseBiome != null ? this.baseBiome.isEqualTo(biome) : (biome == this || (biome != null && this.getBiomeClass() == biome.getBiomeClass()));
public Biome(float temperature, float humidity) {
this(temperature, humidity, Scaling.VARYING_LOW);
}
}

View file

@ -1,5 +0,0 @@
package common.biome;
public enum Temperature {
SEA, COLD, MEDIUM, WARM;
}

View file

@ -234,7 +234,7 @@ public abstract class Dimension extends Section {
private float depth = 0.1f; // g.perlin
private float scale = 0.2f; // g.perlin
private Biome defaultBiome = Biome.NONE; // biomegen
private Biome defaultBiome = null; // biomegen
private State filler = Blocks.air.getState(); // caves+rav, liquid, ore, g.perlin, g.cavern, g.island,
// g.simple, g.flat (sealevel), r.biome, r.simple, r.alternate, r.toplayer
@ -507,7 +507,7 @@ public abstract class Dimension extends Section {
public final Dimension setBiomeGen(Biome mainBiome, boolean semiFixed, int biomeSize, int riverSize, int snowRarity, int seaRarity,
int addRarity, Biome ... add) {
this.defaultBiome = mainBiome;
this.defaultBiome = mainBiome; //TODO: save
this.semiFixed = semiFixed;
this.biomeSize = biomeSize;
this.riverSize = riverSize;
@ -1128,7 +1128,7 @@ public abstract class Dimension extends Section {
this.snowRarity = tag.getInt("SnowRarity");
this.seaRarity = tag.getInt("SeaRarity");
this.addRarity = tag.getInt("AddRarity");
this.defaultBiome = Biome.findByName(tag.getString("DefaultBiome"));
// this.defaultBiome = Biome.findByName(tag.getString("DefaultBiome"));
this.semiFixed = tag.getBool("SemiFixed");
this.defaultWeather = Weather.getByName(tag.getString("DefaultWeather"));
this.defaultWeather = this.weather = this.defaultWeather == null ? Weather.CLEAR : this.defaultWeather;
@ -1149,81 +1149,81 @@ public abstract class Dimension extends Section {
else {
this.layers = null;
}
if(tag.hasStringArray("AddBiomes")) {
String[] list = tag.getStringArray("AddBiomes");
if(list.length == 0) {
this.addBiomes = null;
}
else {
this.addBiomes = new Biome[list.length];
for(int z = 0; z < this.addBiomes.length; z++) {
this.addBiomes[z] = Biome.findByName(list[z]);
}
}
}
else {
this.addBiomes = null;
}
if(tag.hasStringArray("FrostBiomes")) {
String[] list = tag.getStringArray("FrostBiomes");
if(list.length == 0) {
this.frostBiomes = null;
}
else {
this.frostBiomes = new Biome[list.length];
for(int z = 0; z < this.frostBiomes.length; z++) {
this.frostBiomes[z] = Biome.findByName(list[z]);
}
}
}
else {
this.frostBiomes = null;
}
if(tag.hasStringArray("ColdBiomes")) {
String[] list = tag.getStringArray("ColdBiomes");
if(list.length == 0) {
this.coldBiomes = null;
}
else {
this.coldBiomes = new Biome[list.length];
for(int z = 0; z < this.coldBiomes.length; z++) {
this.coldBiomes[z] = Biome.findByName(list[z]);
}
}
}
else {
this.coldBiomes = null;
}
if(tag.hasStringArray("MediumBiomes")) {
String[] list = tag.getStringArray("MediumBiomes");
if(list.length == 0) {
this.mediumBiomes = null;
}
else {
this.mediumBiomes = new Biome[list.length];
for(int z = 0; z < this.mediumBiomes.length; z++) {
this.mediumBiomes[z] = Biome.findByName(list[z]);
}
}
}
else {
this.mediumBiomes = null;
}
if(tag.hasStringArray("HotBiomes")) {
String[] list = tag.getStringArray("HotBiomes");
if(list.length == 0) {
this.hotBiomes = null;
}
else {
this.hotBiomes = new Biome[list.length];
for(int z = 0; z < this.hotBiomes.length; z++) {
this.hotBiomes[z] = Biome.findByName(list[z]);
}
}
}
else {
this.hotBiomes = null;
}
// if(tag.hasStringArray("AddBiomes")) {
// String[] list = tag.getStringArray("AddBiomes");
// if(list.length == 0) {
// this.addBiomes = null;
// }
// else {
// this.addBiomes = new Biome[list.length];
// for(int z = 0; z < this.addBiomes.length; z++) {
// this.addBiomes[z] = Biome.findByName(list[z]);
// }
// }
// }
// else {
// this.addBiomes = null;
// }
// if(tag.hasStringArray("FrostBiomes")) {
// String[] list = tag.getStringArray("FrostBiomes");
// if(list.length == 0) {
// this.frostBiomes = null;
// }
// else {
// this.frostBiomes = new Biome[list.length];
// for(int z = 0; z < this.frostBiomes.length; z++) {
// this.frostBiomes[z] = Biome.findByName(list[z]);
// }
// }
// }
// else {
// this.frostBiomes = null;
// }
// if(tag.hasStringArray("ColdBiomes")) {
// String[] list = tag.getStringArray("ColdBiomes");
// if(list.length == 0) {
// this.coldBiomes = null;
// }
// else {
// this.coldBiomes = new Biome[list.length];
// for(int z = 0; z < this.coldBiomes.length; z++) {
// this.coldBiomes[z] = Biome.findByName(list[z]);
// }
// }
// }
// else {
// this.coldBiomes = null;
// }
// if(tag.hasStringArray("MediumBiomes")) {
// String[] list = tag.getStringArray("MediumBiomes");
// if(list.length == 0) {
// this.mediumBiomes = null;
// }
// else {
// this.mediumBiomes = new Biome[list.length];
// for(int z = 0; z < this.mediumBiomes.length; z++) {
// this.mediumBiomes[z] = Biome.findByName(list[z]);
// }
// }
// }
// else {
// this.mediumBiomes = null;
// }
// if(tag.hasStringArray("HotBiomes")) {
// String[] list = tag.getStringArray("HotBiomes");
// if(list.length == 0) {
// this.hotBiomes = null;
// }
// else {
// this.hotBiomes = new Biome[list.length];
// for(int z = 0; z < this.hotBiomes.length; z++) {
// this.hotBiomes[z] = Biome.findByName(list[z]);
// }
// }
// }
// else {
// this.hotBiomes = null;
// }
this.ores.clear();
if(tag.hasList("Ores")) {
List<TagObject> list = tag.getList("Ores");
@ -1348,7 +1348,7 @@ public abstract class Dimension extends Section {
tag.setInt("SnowRarity", this.snowRarity);
tag.setInt("SeaRarity", this.seaRarity);
tag.setInt("AddRarity", this.addRarity);
tag.setString("DefaultBiome", this.defaultBiome.getName());
// tag.setString("DefaultBiome", this.defaultBiome.getName());
tag.setBool("SemiFixed", this.semiFixed);
tag.setString("DefaultWeather", this.defaultWeather.getName());
tag.setString("DefaultLeaves", this.defaultLeaves.getName());
@ -1364,41 +1364,41 @@ public abstract class Dimension extends Section {
}
tag.setStringArray("Layers", list);
}
if(this.addBiomes != null) {
String[] list = new String[this.addBiomes.length];
for(int z = 0; z < this.addBiomes.length; z++) {
list[z] = this.addBiomes[z].getName();
}
tag.setStringArray("AddBiomes", list);
}
if(this.frostBiomes != null) {
String[] list = new String[this.frostBiomes.length];
for(int z = 0; z < this.frostBiomes.length; z++) {
list[z] = this.frostBiomes[z].getName();
}
tag.setStringArray("FrostBiomes", list);
}
if(this.coldBiomes != null) {
String[] list = new String[this.coldBiomes.length];
for(int z = 0; z < this.coldBiomes.length; z++) {
list[z] = this.coldBiomes[z].getName();
}
tag.setStringArray("ColdBiomes", list);
}
if(this.mediumBiomes != null) {
String[] list = new String[this.mediumBiomes.length];
for(int z = 0; z < this.mediumBiomes.length; z++) {
list[z] = this.mediumBiomes[z].getName();
}
tag.setStringArray("MediumBiomes", list);
}
if(this.hotBiomes != null) {
String[] list = new String[this.hotBiomes.length];
for(int z = 0; z < this.hotBiomes.length; z++) {
list[z] = this.hotBiomes[z].getName();
}
tag.setStringArray("HotBiomes", list);
}
// if(this.addBiomes != null) {
// String[] list = new String[this.addBiomes.length];
// for(int z = 0; z < this.addBiomes.length; z++) {
// list[z] = this.addBiomes[z].getName();
// }
// tag.setStringArray("AddBiomes", list);
// }
// if(this.frostBiomes != null) {
// String[] list = new String[this.frostBiomes.length];
// for(int z = 0; z < this.frostBiomes.length; z++) {
// list[z] = this.frostBiomes[z].getName();
// }
// tag.setStringArray("FrostBiomes", list);
// }
// if(this.coldBiomes != null) {
// String[] list = new String[this.coldBiomes.length];
// for(int z = 0; z < this.coldBiomes.length; z++) {
// list[z] = this.coldBiomes[z].getName();
// }
// tag.setStringArray("ColdBiomes", list);
// }
// if(this.mediumBiomes != null) {
// String[] list = new String[this.mediumBiomes.length];
// for(int z = 0; z < this.mediumBiomes.length; z++) {
// list[z] = this.mediumBiomes[z].getName();
// }
// tag.setStringArray("MediumBiomes", list);
// }
// if(this.hotBiomes != null) {
// String[] list = new String[this.hotBiomes.length];
// for(int z = 0; z < this.hotBiomes.length; z++) {
// list[z] = this.hotBiomes[z].getName();
// }
// tag.setStringArray("HotBiomes", list);
// }
if(!this.ores.isEmpty()) {
List<TagObject> list = Lists.newArrayList();
for(Ore gen : this.ores) {

View file

@ -1,6 +1,5 @@
package common.dimension;
import common.biome.Biome;
import common.world.World;
public final class Space extends Dimension {

View file

@ -5,6 +5,7 @@ import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import common.biome.Biome;
import common.biome.Scaling;
import common.collect.Lists;
import common.collect.Maps;
import common.collect.Sets;
@ -17,7 +18,6 @@ import common.dimension.Galaxy;
import common.dimension.Moon;
import common.dimension.Section;
import common.dimension.Planet;
import common.dimension.RngSpawn;
import common.dimension.Sector;
import common.dimension.Semi;
import common.dimension.Space;
@ -37,7 +37,6 @@ import common.entity.animal.EntityWolf;
import common.entity.npc.EntityArachnoid;
import common.entity.npc.EntityBloodElf;
import common.entity.npc.EntityCultivator;
import common.entity.npc.EntityDwarf;
import common.entity.npc.EntityElf;
import common.entity.npc.EntityFireDemon;
import common.entity.npc.EntityHaunter;
@ -51,7 +50,6 @@ import common.entity.npc.EntityUndead;
import common.entity.npc.EntityWoodElf;
import common.entity.npc.EntityZombie;
import common.entity.types.EntityLiving;
import common.rng.WeightedList;
import common.world.Weather;
import java.util.Set;
@ -428,77 +426,62 @@ public abstract class UniverseRegistry {
private static void registerMoon(String display, int radius, long orbitRotation, float gravity, float temperature) {
registerMoon(display, new Moon(radius, orbitRotation, gravity, temperature));
}
/*public class BiomeBlackened extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntityMetalhead.class, 50, 1, 1));
}
}
public class BiomeChaos extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
for(Class<? extends Entity> clazz : EntityRegistry.getAllClasses()) {
if(EntityLiving.class.isAssignableFrom(clazz))
mobs.add(new RngSpawn((Class<? extends EntityLiving>)clazz, 1, 1, 8));
}
}
}
// public static final Biome PLAIN = new Biome(12.0f, 40.0f, Scaling.PLAINS_LOW);
// public static final Biome DESERT = new Biome(60.0f, 0.0f, Scaling.PLAINS_LOW);
// public static final Biome HILLS = new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE);
// public static final Biome FOREST = new Biome(8.0f, 80.0f);
// public static final Biome TAIGA = new Biome(-10.0f, 80.0f, Scaling.PLAINS_MEDIUM);
// public static final Biome SWAMP = new Biome(12.0f, 90.0f, Scaling.SEA_POND);
// public static final Biome ICE = new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW);
// public static final Biome ICE_HILLS = new Biome(-20.0f, 50.0f, Scaling.HILLS_LOW);
// public static final Biome BEACH = new Biome(12.0f, 40.0f, Scaling.SEA_SHORE);
// public static final Biome DESERT_HILLS = new Biome(60.0f, 0.0f, Scaling.HILLS_LOW);
// public static final Biome FOREST_HILLS = new Biome(8.0f, 80.0f, Scaling.HILLS_LOW);
// public static final Biome TAIGA_HILLS = new Biome(-10.0f, 80.0f, Scaling.HILLS_LOW);
// public static final Biome HILLS_EDGE = new Biome(-12.0f, 30.0f, Scaling.HILLS_MEDIUM);
// public static final Biome TROPIC = new Biome(18.0f, 90.0f);
// public static final Biome TROPIC_HILLS = new Biome(18.0f, 90.0f, Scaling.HILLS_LOW);
// public static final Biome TROPIC_EDGE = new Biome(18.0f, 80.0f);
// public static final Biome STONE_BEACH = new Biome(-12.0f, 30.0f, Scaling.SEA_VARYING);
// public static final Biome ICE_BEACH = new Biome(-18.0f, 30.0f, Scaling.SEA_SHORE);
// public static final Biome BIRCH_FOREST = new Biome(4.0f, 60.0f);
// public static final Biome BIRCH_HILLS = new Biome(4.0f, 60.0f, Scaling.HILLS_LOW);
// public static final Biome DARK_FOREST = new Biome(8.0f, 80.0f);
// public static final Biome ICE_TAIGA = new Biome(-40.0f, 40.0f, Scaling.PLAINS_MEDIUM);
// public static final Biome ICE_TAIGA_HILLS = new Biome(-40.0f, 40.0f, Scaling.HILLS_LOW);
// public static final Biome LARGE_TAIGA = new Biome(-8.0f, 80.0f, Scaling.PLAINS_MEDIUM);
// public static final Biome LARGE_TAIGA_HILLS = new Biome(-8.0f, 80.0f, Scaling.HILLS_LOW);
// public static final Biome LARGE_HILLS = new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE);
// public static final Biome SAVANNA = new Biome(28.0f, 0.0f, Scaling.PLAINS_LOW);
// public static final Biome SAVANNA_PLATEAU = new Biome(20.0f, 0.0f, Scaling.HILLS_PLATEAU);
//
// public static final Biome DESERT_MOD = new Biome(60.0f, 0.0f, 0.225F, 0.25F);
// public static final Biome HILLS_MOD = new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE);
// public static final Biome FLOWER_FOREST = new Biome(8.0f, 80.0f, 0.1F, 0.4F);
// public static final Biome TAIGA_MOD = new Biome(-10.0f, 80.0f, 0.3F, 0.4F);
// public static final Biome SWAMP_MOD = new Biome(12.0f, 90.0f, -0.1F, 0.3F);
// public static final Biome ICE_SPIKES = new Biome(-20.0f, 50.0f, 0.425F, 0.45F);
// public static final Biome TROPIC_MOD = new Biome(18.0f, 90.0f, 0.2F, 0.4F);
// public static final Biome TROPIC_EDGE_MOD = new Biome(18.0f, 80.0f, 0.2F, 0.4F);
// public static final Biome BIRCH_FOREST_MOD = new Biome(4.0f, 60.0f, 0.2F, 0.4F);
// public static final Biome BIRCH_HILLS_MOD = new Biome(4.0f, 60.0f, 0.55F, 0.5F);
// public static final Biome DARK_FOREST_MOD = new Biome(8.0f, 80.0f, 0.2F, 0.4F);
// public static final Biome ICE_TAIGA_MOD = new Biome(-40.0f, 40.0f, 0.3F, 0.4F);
// public static final Biome SPRUCE_TAIGA = new Biome(-10.0f, 80.0f, Scaling.PLAINS_MEDIUM);
// public static final Biome REDWOOD_TAIGA = new Biome(-10.0f, 80.0f, 0.3F, 0.4F);
// public static final Biome LARGE_HILLS_MOD = new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE);
// public static final Biome SAVANNA_MOD = new Biome(24.0f, 0.0f, 0.3625F, 1.225F);
// public static final Biome SAVANNA_PLATEAU_MOD = new Biome(20.0f, 0.0f, 1.05F, 1.2125F);
//
// .setBiomeGen(Biome.FOREST, false, 4, 4, 6, 50).enableMobs().enableSnow()
// .setFrostBiomes(Biome.ICE, Biome.ICE, Biome.ICE, Biome.ICE_TAIGA, Biome.LARGE_TAIGA)
// .setColdBiomes(Biome.FOREST, Biome.HILLS, Biome.TAIGA, Biome.PLAIN)
// .setMediumBiomes(Biome.FOREST, Biome.DARK_FOREST, Biome.HILLS, Biome.PLAIN, Biome.BIRCH_FOREST,
// Biome.SWAMP, Biome.TROPIC)
// .setHotBiomes(Biome.DESERT, Biome.DESERT, Biome.DESERT, Biome.SAVANNA, Biome.SAVANNA, Biome.PLAIN)
public class BiomeHell extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntityFireDemon.class, 50, 4, 4));
mobs.add(new RngSpawn(EntityTiefling.class, 100, 4, 4));
mobs.add(new RngSpawn(EntityBloodElf.class, 50, 2, 10));
mobs.add(new RngSpawn(EntityCultivator.class, 10, 1, 1));
}
}
public class BiomeMetalHell extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntityFireDemon.class, 50, 4, 4));
mobs.add(new RngSpawn(EntityTiefling.class, 100, 4, 4));
mobs.add(new RngSpawn(EntityBloodElf.class, 10, 1, 2));
mobs.add(new RngSpawn(EntityMetalhead.class, 1, 1, 1));
}
}
public class BiomeMushroom extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntityDwarf.class, 8, 4, 8));
}
}
public class BiomeSnowLand extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntitySheep.class, 50, 4, 4));
mobs.add(new RngSpawn(EntitySpirit.class, 10, 1, 1));
}
}
public class BiomeTian extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntityCultivator.class, 50, 1, 1));
mobs.add(new RngSpawn(EntityMerfolk.class, 10, 4, 4));
mobs.add(new RngSpawn(EntityRabbit.class, 10, 3, 10));
mobs.add(new RngSpawn(EntityBat.class, 10, 8, 8));
mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8));
}
}
public class BiomeElvenForest extends MobPopulator {
protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new RngSpawn(EntitySheep.class, 12, 4, 4));
mobs.add(new RngSpawn(EntityRabbit.class, 10, 3, 10));
mobs.add(new RngSpawn(EntityChicken.class, 10, 4, 4));
mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8));
mobs.add(new RngSpawn(EntityWoodElf.class, 100, 4, 16));
mobs.add(new RngSpawn(EntityElf.class, 12, 4, 16));
mobs.add(new RngSpawn(EntityFox.class, 3, 2, 5));
}
}
*/
static void register() { //TODO: add mushroom 0.2F, 0.3F
static void register() { // TODO: add mushroom 0.2F, 0.3F .addSpawn(EntityDwarf.class, 8, 4, 8)
register("space", "Der Weltraum", Space.INSTANCE);
registerGalaxy("milkyway", "Galaxie Milchstraße", () -> {
@ -507,12 +490,12 @@ public abstract class UniverseRegistry {
registerPlanet("Terra", new Planet(6378136, 8766144L, 24000L, 28.0f, 9.81f, 259.15f)
.setPerlinGen(Blocks.stone.getState(), Blocks.water.getState(), 63)
.setTerranianReplacer(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState())
.setBiomeGen(Biome.FOREST, false, 4, 4, 6, 50).enableMobs().enableSnow()
.setFrostBiomes(Biome.ICE, Biome.ICE, Biome.ICE, Biome.ICE_TAIGA, Biome.LARGE_TAIGA)
.setColdBiomes(Biome.FOREST, Biome.HILLS, Biome.TAIGA, Biome.PLAIN)
.setMediumBiomes(Biome.FOREST, Biome.DARK_FOREST, Biome.HILLS, Biome.PLAIN, Biome.BIRCH_FOREST,
Biome.SWAMP, Biome.TROPIC)
.setHotBiomes(Biome.DESERT, Biome.DESERT, Biome.DESERT, Biome.SAVANNA, Biome.SAVANNA, Biome.PLAIN)
.setBiomeGen(new Biome(8.0f, 80.0f), false, 4, 4, 6, 50).enableSnow()
.setFrostBiomes(new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-20.0f, 50.0f, Scaling.PLAINS_LOW), new Biome(-40.0f, 40.0f, Scaling.PLAINS_MEDIUM), new Biome(-8.0f, 80.0f, Scaling.PLAINS_MEDIUM))
.setColdBiomes(new Biome(8.0f, 80.0f), new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE), new Biome(-10.0f, 80.0f, Scaling.PLAINS_MEDIUM), new Biome(12.0f, 40.0f, Scaling.PLAINS_LOW))
.setMediumBiomes(new Biome(8.0f, 80.0f), new Biome(8.0f, 80.0f, 0.1F, 0.4F), new Biome(8.0f, 80.0f), new Biome(-12.0f, 30.0f, Scaling.HILLS_LARGE), new Biome(12.0f, 40.0f, Scaling.PLAINS_LOW), new Biome(4.0f, 60.0f),
new Biome(12.0f, 90.0f, Scaling.SEA_POND), new Biome(18.0f, 90.0f))
.setHotBiomes(new Biome(60.0f, 0.0f, Scaling.PLAINS_LOW), new Biome(60.0f, 0.0f, Scaling.PLAINS_LOW), new Biome(60.0f, 0.0f, Scaling.HILLS_LOW), new Biome(28.0f, 0.0f, Scaling.PLAINS_LOW), new Biome(20.0f, 0.0f, Scaling.HILLS_PLATEAU), new Biome(12.0f, 40.0f, Scaling.PLAINS_LOW))
.enableCavesRavines(Blocks.lava.getState()).setDungeons(8)
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), Blocks.stone.getState(), null, 8, 8, 255, true)
@ -612,17 +595,24 @@ public abstract class UniverseRegistry {
registerPlanet("gharoth", "Elbenplanet Gharoth", new Planet(2806382, 4837386L, 52960L, 30.0f, 10.0f, 257.3f + 8.0f) //TODO: check temp
.setSimpleGen(Blocks.dirt.getState(), Blocks.water.getState(), 64)
.setSimpleReplacer(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState())
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs().enableSnow()
.enableCaves(Blocks.air.getState()).setDungeons(4).enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
.addOre(Blocks.thetium_ore.getState(), 1, 0, 3, 0, 14, false)
.addOre(Blocks.gyriyn_ore.getState(), 0, 2, 3, 0, 12, false));
.addOre(Blocks.gyriyn_ore.getState(), 0, 2, 3, 0, 12, false)
.addSpawn(EntitySheep.class, 12, 4, 4)
.addSpawn(EntityRabbit.class, 10, 3, 10)
.addSpawn(EntityChicken.class, 10, 4, 4)
.addSpawn(EntityMouse.class, 10, 8, 8)
.addSpawn(EntityWoodElf.class, 100, 4, 16)
.addSpawn(EntityElf.class, 12, 4, 16)
.addSpawn(EntityFox.class, 3, 2, 5));
registerPlanet("transylvania", "Vampirplanet Transsylvanien", new Planet(8374921, 33850466L, 49760L, 20.0f, 10.0f, 255.5f)
.setPerlinGen(Blocks.rock.getState(), Blocks.water.getState(), 63)
.setTerranianReplacer(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState()).setBiomeGen(Biome.FOREST, true, 5, 3, 3, 30)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(10).enableMobs().enableSnow()
.setTerranianReplacer(Blocks.grass.getState(), Blocks.dirt.getState(), Blocks.gravel.getState(), Blocks.sand.getState()).setBiomeGen(new Biome(8.0f, 80.0f), true, 5, 3, 3, 30)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(10).enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_water.getState(), 50, 8, 255, false)
@ -642,14 +632,18 @@ public abstract class UniverseRegistry {
.addSpawn(EntityWolf.class, 5, 2, 4)
.addSpawn(EntityHorse.class, 5, 2, 6), () -> {
registerMoon("yrdinath", "Eismond Yrdinath", new Moon(0xccccff, 2503812, 46743637L, 17460L, 2.5f, 239.15f, Blocks.snow, Blocks.ice, 0.1F, 0.2F) //TODO: check height
.enableMobs().enableSnow().setDefaultWeather(Weather.SNOW));
.enableSnow().setDefaultWeather(Weather.SNOW)
.addSpawn(EntitySheep.class, 50, 4, 4)
.addSpawn(EntitySpirit.class, 10, 1, 1));
registerMoon("mythril", "Eismond Mythril", new Moon(0xbbbbff, 2213749, 42659432L, 15330L, 2.25f, 221.65f, Blocks.snow, Blocks.ice, 0.1F, 0.2F)
.enableMobs().enableSnow().setDefaultWeather(Weather.SNOW));
.enableSnow().setDefaultWeather(Weather.SNOW)
.addSpawn(EntitySheep.class, 50, 4, 4)
.addSpawn(EntitySpirit.class, 10, 1, 1));
});
registerPlanet("mesar", "Wüstenplanet Me'sar", new Planet(0xff7f3f, 0xff6022, 0xff6f00, 9823183, 56643366L, 87340L, 11.0f, 333.15f)
.setPerlinGen(Blocks.rock.getState(), Blocks.air.getState(), 63, 0.2f, 0.4f)
.setMesarianReplacer(Blocks.red_sand.getState())
.enableCavesRavines(Blocks.lava.getState()).enableMobs()
.enableCavesRavines(Blocks.lava.getState())
.addLake(Blocks.lava.getState(), null, null, 8, 8, 255, true)
.addLiquid(Blocks.flowing_lava.getState(), 20, 8, 255, true)
.addOre(Blocks.iron_ore.getState(), 6, 2, 24, 0, 64, false)
@ -667,62 +661,96 @@ public abstract class UniverseRegistry {
registerPlanet("blackplanet", "Der Schwarze Planet", new Planet(0x000000, 0x000000, 0x000000, 13038204, 4632918508L, 204556L, 12.0f, 0.0f)
.setPerlinGen(Blocks.blackened_stone.getState(), Blocks.goo.getState(), 63)
.setSimpleAltReplacer(Blocks.blackened_soil.getState(), Blocks.blackened_dirt.getState(), Blocks.blackened_cobble.getState())
.enableCaves(Blocks.air.getState()).setDungeons(4).enableMobs()
.enableCaves(Blocks.air.getState()).setDungeons(4)
.addLake(Blocks.goo.getState(), null, null, 8, 8, 255, true)
// .addOre(Blocks.PLACEHOLDER_ore.getState(), 0, 2, 3, 0, 12, false)
.addSpawn(EntityMetalhead.class, 50, 1, 1)
);
});
});
});
registerSemi("warp", "Der Warp", new Semi(0x0c001f, 0x190033, 124072917, 285.0f, 3).setCloudTexture(CloudType.DENSE).setCloudHeight(238.0f)
.setPerlinGen(Blocks.obsidian.getState(), Blocks.lava.getState(), 63, 1.0F, 2.0F)
.enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableMobs().enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.obsidian.getState(), 8, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 1, 8, 255, false)
.addLiquid(Blocks.flowing_water.getState(), 1, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true)
.setStarBrightness(0.9f).setDeepStarBrightness(0.6f)
.setStarColorSin(25.0f, 0.1f, 0.25f, 0xff00ff, 1, 4).setDeepStarColorSin(25.0f, 0.1f, 0.5f, 0xff00ff, 1, 4));
Dimension warp = new Semi(0x0c001f, 0x190033, 124072917, 285.0f, 3).setCloudTexture(CloudType.DENSE).setCloudHeight(238.0f)
.setPerlinGen(Blocks.obsidian.getState(), Blocks.lava.getState(), 63, 1.0F, 2.0F)
.enableCavesRavines(Blocks.air.getState()).enableLongCaves().enableSnow()
.addLake(Blocks.water.getState(), null, Blocks.obsidian.getState(), 8, 0, 255, false)
.addLake(Blocks.lava.getState(), null, null, 1, 8, 255, false)
.addLiquid(Blocks.flowing_water.getState(), 1, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true)
.setStarBrightness(0.9f).setDeepStarBrightness(0.6f)
.setStarColorSin(25.0f, 0.1f, 0.25f, 0xff00ff, 1, 4).setDeepStarColorSin(25.0f, 0.1f, 0.5f, 0xff00ff, 1, 4);
for(Class<? extends Entity> clazz : EntityRegistry.getAllClasses()) {
if(EntityLiving.class.isAssignableFrom(clazz))
warp.addSpawn((Class<? extends EntityLiving>)clazz, 1, 1, 8);
}
registerSemi("warp", "Der Warp", warp);
registerDomain("Tian'Xin", () -> {
registerArea("Ni'enrath", new Area(0x7f00ff, 532109, 276.15f, 1).setLightColor(0x07000f).setBlockColor(0xcf6fff)
.setPerlinGen(Blocks.tian.getState(), Blocks.spring_water.getState(), 63, 0.1F, 1.0F)
.setSimpleAltReplacer(Blocks.tian_soil.getState(), Blocks.tian.getState()).enableLongCaves().enableMobs().enableSnow()
.setSimpleAltReplacer(Blocks.tian_soil.getState(), Blocks.tian.getState()).enableLongCaves().enableSnow()
.addLake(Blocks.spring_water.getState(), Blocks.tian.getState(), Blocks.tian.getState(), 4, 0, 255, false)
.addLiquid(Blocks.flowing_spring_water.getState(), 50, 8, 255, false));
.addLiquid(Blocks.flowing_spring_water.getState(), 50, 8, 255, false)
.addSpawn(EntityCultivator.class, 50, 1, 1)
.addSpawn(EntityMerfolk.class, 10, 4, 4)
.addSpawn(EntityRabbit.class, 10, 3, 10)
.addSpawn(EntityBat.class, 10, 8, 8)
.addSpawn(EntityMouse.class, 10, 8, 8));
});
registerDomain("Digital", () -> {
registerArea("Cyberspace", new Area(0x000000, 16777216, 293.15f, 15).setLightColor(0x00ff00).setBlockColor(0xff0000).enableBlockLightSubtraction()
.setFlatGen(Blocks.green_clay.getState(), 2)
.enableMobs());
.setFlatGen(Blocks.green_clay.getState(), 2));
});
registerDomain("hell", "Hölle", () -> {
registerArea("thedric", "Kreis Thedric", new Area(0x330707, 105639735, 347.15f, 2).enableLongCaves().enableMobs().enableFortresses()
registerArea("thedric", "Kreis Thedric", new Area(0x330707, 105639735, 347.15f, 2).enableLongCaves().enableFortresses()
.enableWorldCeiling().enableDenseFog()
.setCavernGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63)
.setSurfaceReplacer(Blocks.gravel.getState(), Blocks.soul_sand.getState()));
registerArea("kyroth", "Kreis Kyroth", new Area(0x990000, 86742970, 387.15f, 3).enableLongCaves().enableMobs()
.setSurfaceReplacer(Blocks.gravel.getState(), Blocks.soul_sand.getState())
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 10, 1, 2)
.addSpawn(EntityMetalhead.class, 1, 1, 1));
registerArea("kyroth", "Kreis Kyroth", new Area(0x990000, 86742970, 387.15f, 3).enableLongCaves()
.setSimpleGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 64)
.setSimpleReplacer(Blocks.obsidian.getState(), Blocks.soul_sand.getState())
.addLake(Blocks.lava.getState(), null, null, 4, 8, 255, false)
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true));
registerArea("ahrd", "Kreis Ahrd", new Area(0xcc0000, 67028432, 467.15f, 15).enableLongCaves().enableMobs()
.addLiquid(Blocks.flowing_lava.getState(), 40, 8, 255, true)
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 50, 2, 10)
.addSpawn(EntityCultivator.class, 10, 1, 1));
registerArea("ahrd", "Kreis Ahrd", new Area(0xcc0000, 67028432, 467.15f, 15).enableLongCaves()
.setPerlinGen(Blocks.hellrock.getState(), Blocks.lava.getState(), 63, 1.0F, 0.5F)
.setSimpleAltReplacer(Blocks.soul_sand.getState())
.addLake(Blocks.lava.getState(), Blocks.soul_sand.getState(), Blocks.soul_sand.getState(),
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true));
registerArea("mizorath", "Kreis Mizorath", new Area(0xff0000, 54029584, 1067.15f, 15).enableMobs()
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true)
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 50, 2, 10)
.addSpawn(EntityCultivator.class, 10, 1, 1));
registerArea("mizorath", "Kreis Mizorath", new Area(0xff0000, 54029584, 1067.15f, 15)
.setPerlinGen(Blocks.hellrock.getState(), Blocks.blood.getState(), 63, -0.2F, 0.1F)
.setSimpleAltReplacer(Blocks.soul_sand.getState()));
registerArea("dargoth", "Kreis Dargoth", new Area(0xff3f0c, 43293629, 1707.15f, 15).enableMobs()
.setSimpleAltReplacer(Blocks.soul_sand.getState())
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 50, 2, 10)
.addSpawn(EntityCultivator.class, 10, 1, 1));
registerArea("dargoth", "Kreis Dargoth", new Area(0xff3f0c, 43293629, 1707.15f, 15)
.setPerlinGen(Blocks.hellrock.getState(), Blocks.magma.getState(), 63, -0.2F, 0.1F)
.setSimpleAltReplacer(Blocks.soul_sand.getState()));
registerArea("aasirith", "Kreis Aasirith", new Area(0x191919, 36291872, 2482.0f, 1).enableLongCaves().enableMobs()
.setSimpleAltReplacer(Blocks.soul_sand.getState())
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 50, 2, 10)
.addSpawn(EntityCultivator.class, 10, 1, 1));
registerArea("aasirith", "Kreis Aasirith", new Area(0x191919, 36291872, 2482.0f, 1).enableLongCaves()
.setPerlinGen(Blocks.rock.getState(), Blocks.magma.getState(), 63, 0.125F, 0.05F)
.setSimpleAltReplacer(Blocks.ash.getState(), Blocks.rock.getState(), Blocks.ash.getState())
.addLake(Blocks.lava.getState(), Blocks.rock.getState(), Blocks.rock.getState(),
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true));
2, 8, 255, false).addLiquid(Blocks.flowing_lava.getState(), 80, 8, 255, true)
.addSpawn(EntityFireDemon.class, 50, 4, 4)
.addSpawn(EntityTiefling.class, 100, 4, 4)
.addSpawn(EntityBloodElf.class, 50, 2, 10)
.addSpawn(EntityCultivator.class, 10, 1, 1));
});
}
}