biome fixes + refactoring, blackened

This commit is contained in:
Sen 2025-04-14 12:35:45 +02:00
parent 6d912ae7ac
commit 1834c26b72
41 changed files with 296 additions and 328 deletions

View file

@ -1721,7 +1721,7 @@ public class Game implements IThreadListener {
+ String.format("%.3f", this.theWorld.getCelestialAngle(1.0f)); + String.format("%.3f", this.theWorld.getCelestialAngle(1.0f));
} }
float temp = this.theWorld.getTempOffset() + (biome != null ? biome.getFloatTemperature(blockpos) : 0.0f); float temp = this.theWorld.getTempOffset() + (biome != null ? biome.getTemperature(blockpos) : 0.0f);
long ticked = System.currentTimeMillis() - this.lastTicked; long ticked = System.currentTimeMillis() - this.lastTicked;
return return

View file

@ -27,13 +27,11 @@ import game.entity.npc.EntityMage;
import game.entity.npc.EntitySlime; import game.entity.npc.EntitySlime;
import game.entity.npc.EntityUndead; import game.entity.npc.EntityUndead;
import game.entity.npc.EntityZombie; import game.entity.npc.EntityZombie;
import game.entity.types.EntityLiving;
import game.init.Blocks; import game.init.Blocks;
import game.log.Log; import game.log.Log;
import game.material.Material; import game.material.Material;
import game.rng.PerlinGen; import game.rng.PerlinGen;
import game.rng.Random; import game.rng.Random;
import game.rng.RngItem;
import game.rng.WeightedList; import game.rng.WeightedList;
import game.util.ExtMath; import game.util.ExtMath;
import game.world.BlockPos; import game.world.BlockPos;
@ -60,84 +58,64 @@ import game.worldgen.tree.WorldGenBigTree;
import game.worldgen.tree.WorldGenSwamp; import game.worldgen.tree.WorldGenSwamp;
import game.worldgen.tree.WorldGenTree; import game.worldgen.tree.WorldGenTree;
public abstract class Biome public abstract class Biome {
{ private static final Biome[] BIOMES = new Biome[256];
protected static final Biome.Height height_Default = new Biome.Height(0.1F, 0.2F);
protected static final Biome.Height height_ShallowWaters = new Biome.Height(-0.5F, 0.0F);
protected static final Biome.Height height_Sea = new Biome.Height(-1.0F, 0.1F);
protected static final Biome.Height height_DeepSea = new Biome.Height(-1.8F, 0.1F);
protected static final Biome.Height height_LowPlains = new Biome.Height(0.125F, 0.05F);
protected static final Biome.Height height_MidPlains = new Biome.Height(0.2F, 0.2F);
protected static final Biome.Height height_LowHills = new Biome.Height(0.45F, 0.3F);
protected static final Biome.Height height_HighPlateaus = new Biome.Height(1.5F, 0.025F);
protected static final Biome.Height height_MidHills = new Biome.Height(1.0F, 0.5F);
protected static final Biome.Height height_Shores = new Biome.Height(0.0F, 0.025F);
protected static final Biome.Height height_RockyWaters = new Biome.Height(0.1F, 0.8F);
protected static final Biome.Height height_MidRockyPlains = new Biome.Height(0.2F, 0.3F);
protected static final Biome.Height height_PartiallySubmerged = new Biome.Height(-0.2F, 0.1F);
protected static final Biome.Height height_Varying = new Biome.Height(0.1F, 1.0F);
protected static final Biome.Height height_VaryingExtreme = new Biome.Height(1.0F, 2.0F);
private static final Biome[] BIOMES = new Biome[256];
public static final Map<String, Biome> BIOME_ID_MAP = Maps.<String, Biome>newHashMap();
public static final Biome none = (new BiomeNone(0)).setBiomeName("none", "<Keins>"); public static final Biome none = (new BiomeNone(0)).setBiomeName("none", "<Keins>");
public static final Biome plains = (new BiomePlains(1)).setColor(9286496).setBiomeName("plains", "Ebene"); public static final Biome plains = (new BiomePlains(1)).setColor(9286496).setBiomeName("plains", "Ebene");
public static final Biome desert = (new BiomeDesert(2)).setColor(16421912).setBiomeName("desert", "Wüste").setTemperatureLegacy(2.0F).setHumidity(0.0F).setHeight(height_LowPlains); public static final Biome desert = (new BiomeDesert(2)).setColor(16421912).setBiomeName("desert", "Wüste").setTemperature(60.0f).setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome extremeHills = (new BiomeHills(3, false)).setColor(6316128).setBiomeName("extremeHills", "Extremes Bergland").setHeight(height_MidHills).setTemperatureLegacy(0.2F).setHumidity(0.3F); public static final Biome extremeHills = (new BiomeHills(3, false)).setColor(6316128).setBiomeName("extremeHills", "Extremes Bergland").setScaling(Scaling.HILLS_LARGE).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome forest = (new BiomeForest(4, 0)).setColor(353825).setBiomeName("forest", "Wald"); public static final Biome forest = (new BiomeForest(4, 0)).setColor(353825).setBiomeName("forest", "Wald");
public static final Biome taiga = (new BiomeTaiga(5, 0)).setColor(747097).setBiomeName("taiga", "Taiga").setTemperatureLegacy(0.25F).setHumidity(0.8F).setHeight(height_MidPlains); public static final Biome taiga = (new BiomeTaiga(5, 0)).setColor(747097).setBiomeName("taiga", "Taiga").setTemperature(-10.0f).setHumidity(80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome swampland = (new BiomeSwamp(6)).setColor(522674).setBiomeName("swampland", "Sumpf").setHeight(height_PartiallySubmerged).setTemperatureLegacy(0.8F).setHumidity(0.9F); public static final Biome swampland = (new BiomeSwamp(6)).setColor(522674).setBiomeName("swampland", "Sumpf").setScaling(Scaling.SEA_POND).setTemperature(12.0f).setHumidity(90.0f);
public static final Biome river = (new BiomeWater(7, true)).setColor(255).setBiomeName("river", "Fluss").setHeight(height_ShallowWaters); public static final Biome river = (new BiomeWater(7, true)).setColor(255).setBiomeName("river", "Fluss").setScaling(Scaling.SEA_SHALLOW);
public static final Biome exterminated = (new BiomeExterminated(8)).setColor(0x000000).setBiomeName("exterminated", "Ausgelöscht").setHumidity(0.0F).setTemperature(150.0f); public static final Biome exterminated = (new BiomeExterminated(8)).setColor(0x000000).setBiomeName("exterminated", "Ausgelöscht").setHumidity(0.0f).setTemperature(150.0f);
public static final Biome space = (new BiomeSpace(9)).setColor(0x000000).setBiomeName("space", "Leere des Weltraums").setHumidity(0.0F); public static final Biome space = (new BiomeSpace(9)).setColor(0x000000).setBiomeName("space", "Leere des Weltraums").setHumidity(0.0f);
public static final Biome frozenSea = (new BiomeWater(10, false)).setColor(9474208).setBiomeName("frozenSea", "Vereister See").setSnowy().setHeight(height_Sea).setTemperatureLegacy(0.0F).setHumidity(0.5F); public static final Biome frozenSea = (new BiomeWater(10, false)).setColor(9474208).setBiomeName("frozenSea", "Vereister See").enableColdBeach().setScaling(Scaling.SEA_MEDIUM).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome frozenRiver = (new BiomeWater(11, true)).setColor(10526975).setBiomeName("frozenRiver", "Vereister Fluss").setSnowy().setHeight(height_ShallowWaters).setTemperatureLegacy(0.0F).setHumidity(0.5F); public static final Biome frozenRiver = (new BiomeWater(11, true)).setColor(10526975).setBiomeName("frozenRiver", "Vereister Fluss").enableColdBeach().setScaling(Scaling.SEA_SHALLOW).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome icePlains = (new BiomeSnow(12, false)).setColor(16777215).setBiomeName("icePlains", "Eisebene").setSnowy().setTemperatureLegacy(0.0F).setHumidity(0.5F).setHeight(height_LowPlains); public static final Biome icePlains = (new BiomeSnow(12, false)).setColor(16777215).setBiomeName("icePlains", "Eisebene").enableColdBeach().setTemperature(-20.0f).setHumidity(50.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome iceMountains = (new BiomeSnow(13, false)).setColor(10526880).setBiomeName("iceMountains", "Vereistes Bergland").setSnowy().setHeight(height_LowHills).setTemperatureLegacy(0.0F).setHumidity(0.5F); public static final Biome iceMountains = (new BiomeSnow(13, false)).setColor(10526880).setBiomeName("iceMountains", "Vereistes Bergland").enableColdBeach().setScaling(Scaling.HILLS_LOW).setTemperature(-20.0f).setHumidity(50.0f);
public static final Biome mushroomPlains = (new BiomeMushroom(14)).setColor(16711935).setBiomeName("mushroomPlains", "Pilzland").setTemperatureLegacy(0.9F).setHumidity(1.0F).setHeight(height_MidRockyPlains); public static final Biome mushroomPlains = (new BiomeMushroom(14)).setColor(16711935).setBiomeName("mushroomPlains", "Pilzland").setTemperature(16.0f).setHumidity(100.0f).setScaling(Scaling.PLAINS_VARYING);
// public static final Biome mushroomPlainsEdge = (new BiomeMushroom(15)).setColor(10486015).setBiomeName("mushroomPlainsEdge").setTemperatureLegacy(0.9F).setHumidity(1.0F).setHeight(height_Shores); public static final Biome blackened = (new BiomeBlackened(15)).setColor(0x000000).setBiomeName("blackened", "Schwarz").setHumidity(0.0f);
public static final Biome beach = (new BiomeBeach(16)).setColor(16440917).setBiomeName("beach", "Strand").setTemperatureLegacy(0.8F).setHumidity(0.4F).setHeight(height_Shores); public static final Biome beach = (new BiomeBeach(16)).setColor(16440917).setBiomeName("beach", "Strand").setTemperature(12.0f).setHumidity(40.0f).setScaling(Scaling.SEA_SHORE);
public static final Biome desertHills = (new BiomeDesert(17)).setColor(13786898).setBiomeName("desertHills", "Wüsten-Bergland").setTemperatureLegacy(2.0F).setHumidity(0.0F).setHeight(height_LowHills); public static final Biome desertHills = (new BiomeDesert(17)).setColor(13786898).setBiomeName("desertHills", "Wüsten-Bergland").setTemperature(60.0f).setHumidity(0.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome forestHills = (new BiomeForest(18, 0)).setColor(2250012).setBiomeName("forestHills", "Wald-Bergland").setHeight(height_LowHills); public static final Biome forestHills = (new BiomeForest(18, 0)).setColor(2250012).setBiomeName("forestHills", "Wald-Bergland").setScaling(Scaling.HILLS_LOW);
public static final Biome taigaHills = (new BiomeTaiga(19, 0)).setColor(1456435).setBiomeName("taigaHills", "Taiga-Bergland").setTemperatureLegacy(0.25F).setHumidity(0.8F).setHeight(height_LowHills); public static final Biome taigaHills = (new BiomeTaiga(19, 0)).setColor(1456435).setBiomeName("taigaHills", "Taiga-Bergland").setTemperature(-10.0f).setHumidity(80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsEdge = (new BiomeHills(20, true)).setColor(7501978).setBiomeName("extremeHillsEdge", "Extremes Bergland Gr.").setHeight(height_MidHills.attenuate()).setTemperatureLegacy(0.2F).setHumidity(0.3F); public static final Biome extremeHillsEdge = (new BiomeHills(20, true)).setColor(7501978).setBiomeName("extremeHillsEdge", "Extremes Bergland Gr.").setScaling(Scaling.HILLS_MEDIUM).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome jungle = (new BiomeJungle(21, false)).setColor(5470985).setBiomeName("jungle", "Urwald").setTemperatureLegacy(0.95F).setHumidity(0.9F); public static final Biome jungle = (new BiomeJungle(21, false)).setColor(5470985).setBiomeName("jungle", "Urwald").setTemperature(18.0f).setHumidity(90.0f);
public static final Biome jungleHills = (new BiomeJungle(22, false)).setColor(2900485).setBiomeName("jungleHills", "Urwald-Bergland").setTemperatureLegacy(0.95F).setHumidity(0.9F).setHeight(height_LowHills); public static final Biome jungleHills = (new BiomeJungle(22, false)).setColor(2900485).setBiomeName("jungleHills", "Urwald-Bergland").setTemperature(18.0f).setHumidity(90.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome jungleEdge = (new BiomeJungle(23, true)).setColor(6458135).setBiomeName("jungleEdge", "Urwald Gr.").setTemperatureLegacy(0.95F).setHumidity(0.8F); public static final Biome jungleEdge = (new BiomeJungle(23, true)).setColor(6458135).setBiomeName("jungleEdge", "Urwald Gr.").setTemperature(18.0f).setHumidity(80.0f);
public static final Biome sea = (new BiomeWater(24, false)).setColor(112).setBiomeName("sea", "See").setHeight(height_Sea); public static final Biome sea = (new BiomeWater(24, false)).setColor(112).setBiomeName("sea", "See").setScaling(Scaling.SEA_MEDIUM);
public static final Biome stoneBeach = (new BiomeStoneBeach(25)).setColor(10658436).setBiomeName("stoneBeach", "Steinstrand").setTemperatureLegacy(0.2F).setHumidity(0.3F).setHeight(height_RockyWaters); public static final Biome stoneBeach = (new BiomeStoneBeach(25)).setColor(10658436).setBiomeName("stoneBeach", "Steinstrand").setTemperature(-12.0f).setHumidity(30.0f).setScaling(Scaling.SEA_VARYING);
public static final Biome coldBeach = (new BiomeBeach(26)).setColor(16445632).setBiomeName("coldBeach", "Vereister Strand").setTemperatureLegacy(0.05F).setHumidity(0.3F).setHeight(height_Shores).setSnowy(); public static final Biome coldBeach = (new BiomeBeach(26)).setColor(16445632).setBiomeName("coldBeach", "Vereister Strand").setTemperature(-18.0f).setHumidity(30.0f).setScaling(Scaling.SEA_SHORE).enableColdBeach();
public static final Biome birchForest = (new BiomeForest(27, 2)).setBiomeName("birchForest", "Birkenwald").setColor(3175492); public static final Biome birchForest = (new BiomeForest(27, 2)).setBiomeName("birchForest", "Birkenwald").setColor(3175492);
public static final Biome birchForestHills = (new BiomeForest(28, 2)).setBiomeName("birchForestHills", "Birkenwald-Bergland").setColor(2055986).setHeight(height_LowHills); public static final Biome birchForestHills = (new BiomeForest(28, 2)).setBiomeName("birchForestHills", "Birkenwald-Bergland").setColor(2055986).setScaling(Scaling.HILLS_LOW);
public static final Biome roofedForest = (new BiomeForest(29, 3)).setColor(4215066).setBiomeName("roofedForest", "Dichter Wald"); public static final Biome roofedForest = (new BiomeForest(29, 3)).setColor(4215066).setBiomeName("roofedForest", "Dichter Wald");
public static final Biome coldTaiga = (new BiomeTaiga(30, 0)).setColor(3233098).setBiomeName("coldTaiga", "Vereiste Taiga").setSnowy().setTemperatureLegacy(-0.5F).setHumidity(0.4F).setHeight(height_MidPlains); public static final Biome coldTaiga = (new BiomeTaiga(30, 0)).setColor(3233098).setBiomeName("coldTaiga", "Vereiste Taiga").enableColdBeach().setTemperature(-40.0f).setHumidity(40.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome coldTaigaHills = (new BiomeTaiga(31, 0)).setColor(2375478).setBiomeName("coldTaigaHills", "Vereistes Taiga-Bergland").setSnowy().setTemperatureLegacy(-0.5F).setHumidity(0.4F).setHeight(height_LowHills); public static final Biome coldTaigaHills = (new BiomeTaiga(31, 0)).setColor(2375478).setBiomeName("coldTaigaHills", "Vereistes Taiga-Bergland").enableColdBeach().setTemperature(-40.0f).setHumidity(40.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome megaTaiga = (new BiomeTaiga(32, 1)).setColor(5858897).setBiomeName("megaTaiga", "Hohe Taiga").setTemperatureLegacy(0.3F).setHumidity(0.8F).setHeight(height_MidPlains); public static final Biome megaTaiga = (new BiomeTaiga(32, 1)).setColor(5858897).setBiomeName("megaTaiga", "Hohe Taiga").setTemperature(-8.0f).setHumidity(80.0f).setScaling(Scaling.PLAINS_MEDIUM);
public static final Biome megaTaigaHills = (new BiomeTaiga(33, 1)).setColor(4542270).setBiomeName("megaTaigaHills", "Hohes Taiga-Bergland").setTemperatureLegacy(0.3F).setHumidity(0.8F).setHeight(height_LowHills); public static final Biome megaTaigaHills = (new BiomeTaiga(33, 1)).setColor(4542270).setBiomeName("megaTaigaHills", "Hohes Taiga-Bergland").setTemperature(-8.0f).setHumidity(80.0f).setScaling(Scaling.HILLS_LOW);
public static final Biome extremeHillsPlus = (new BiomeHills(34, true)).setColor(5271632).setBiomeName("extremeHillsPlus", "Extremes Bergland +").setHeight(height_MidHills).setTemperatureLegacy(0.2F).setHumidity(0.3F); public static final Biome extremeHillsPlus = (new BiomeHills(34, true)).setColor(5271632).setBiomeName("extremeHillsPlus", "Extremes Bergland +").setScaling(Scaling.HILLS_LARGE).setTemperature(-12.0f).setHumidity(30.0f);
public static final Biome savanna = (new BiomeSavanna(35)).setColor(12431967).setBiomeName("savanna", "Savanne").setTemperature(28.0F).setHumidity(0.0F).setHeight(height_LowPlains); public static final Biome savanna = (new BiomeSavanna(35)).setColor(12431967).setBiomeName("savanna", "Savanne").setTemperature(28.0F).setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome savannaPlateau = (new BiomeSavanna(36)).setColor(10984804).setBiomeName("savannaPlateau", "Savannen-Plateau").setTemperature(20.0F).setHumidity(0.0F).setHeight(height_HighPlateaus); public static final Biome savannaPlateau = (new BiomeSavanna(36)).setColor(10984804).setBiomeName("savannaPlateau", "Savannen-Plateau").setTemperature(20.0F).setHumidity(0.0f).setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesa = (new BiomeMesa(37, false, false)).setColor(14238997).setBiomeName("mesa", "Mesa"); public static final Biome mesa = (new BiomeMesa(37, false, false)).setColor(14238997).setBiomeName("mesa", "Mesa");
public static final Biome mesaPlateau_F = (new BiomeMesa(38, false, true)).setColor(11573093).setBiomeName("mesaPlateauF", "Mesa-Waldplateau").setHeight(height_HighPlateaus); public static final Biome mesaPlateau_F = (new BiomeMesa(38, false, true)).setColor(11573093).setBiomeName("mesaPlateauF", "Mesa-Waldplateau").setScaling(Scaling.HILLS_PLATEAU);
public static final Biome mesaPlateau = (new BiomeMesa(39, false, false)).setColor(13274213).setBiomeName("mesaPlateau", "Mesa-Plateau").setHeight(height_HighPlateaus); public static final Biome mesaPlateau = (new BiomeMesa(39, false, false)).setColor(13274213).setBiomeName("mesaPlateau", "Mesa-Plateau").setScaling(Scaling.HILLS_PLATEAU);
public static final Biome snowLand = (new BiomeSnowLand(40)).setColor(0xffffff).setBiomeName("snowLand", "Eisland").setSnowy().setHumidity(1.0F); public static final Biome snowLand = (new BiomeSnowLand(40)).setColor(0xffffff).setBiomeName("snowLand", "Eisland").enableColdBeach().setHumidity(100.0f);
public static final Biome tian = (new BiomeTian(41)).setColor(0x808080).setBiomeName("tian", "Tian").setHumidity(0.8F).setHeight(height_Varying); public static final Biome tian = (new BiomeTian(41)).setColor(0x808080).setBiomeName("tian", "Tian").setHumidity(80.0f).setScaling(Scaling.VARYING_MEDIUM);
public static final Biome elvenForest = (new BiomeForest(42, 4)).setColor(0x059821).setBiomeName("elvenForest", "Elbenwald").setHumidity(0.9F); public static final Biome elvenForest = (new BiomeForest(42, 4)).setColor(0x059821).setBiomeName("elvenForest", "Elbenwald").setHumidity(90.0f);
public static final Biome upperHell = (new BiomeHell(43, 0)).setColor(16711680).setBiomeName("upperHell", "Übergang in die Hölle").setHumidity(0.0F); public static final Biome upperHell = (new BiomeHell(43, 0)).setColor(16711680).setBiomeName("upperHell", "Übergang in die Hölle").setHumidity(0.0f);
public static final Biome lowerHell = (new BiomeHell(44, 1)).setColor(16711680).setBiomeName("lowerHell", "Abgrund der Hölle").setHumidity(0.0F); public static final Biome lowerHell = (new BiomeHell(44, 1)).setColor(16711680).setBiomeName("lowerHell", "Abgrund der Hölle").setHumidity(0.0f);
public static final Biome hellHills = (new BiomeHell(45, 1)).setColor(16711680).setBiomeName("hellHills", "Bergland der Hölle").setHumidity(0.0F).setHeight(height_MidHills); public static final Biome hellHills = (new BiomeHell(45, 1)).setColor(16711680).setBiomeName("hellHills", "Bergland der Hölle").setHumidity(0.0f).setScaling(Scaling.HILLS_LARGE);
public static final Biome soulPlains = (new BiomeHell(46, 1)).setColor(16711680).setBiomeName("soulPlains", "Seelenland").setHumidity(0.0F).setHeight(height_PartiallySubmerged); public static final Biome soulPlains = (new BiomeHell(46, 1)).setColor(16711680).setBiomeName("soulPlains", "Seelenland").setHumidity(0.0f).setScaling(Scaling.SEA_POND);
public static final Biome ashLand = (new BiomeHell(47, 2)).setColor(16711680).setBiomeName("ashLand", "Verbrannt").setHumidity(0.0F).setHeight(height_LowPlains); public static final Biome ashLand = (new BiomeHell(47, 2)).setColor(16711680).setBiomeName("ashLand", "Verbrannt").setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
// public static final Biome star = (new BiomeStar(46)).setColor(0x000000).setBiomeName("star").setHumidity(0.0F); public static final Biome moon = (new BiomeMoon(48)).setColor(0xa0a0a0).setBiomeName("moon", "Mondoberfläche").setHumidity(0.0f).setScaling(Scaling.PLAINS_LOW);
public static final Biome moon = (new BiomeMoon(48)).setColor(0xa0a0a0).setBiomeName("moon", "Mondoberfläche").setHumidity(0.0F).setHeight(height_LowPlains); public static final Biome chaos = (new BiomeChaos(49)).setColor(0xff00ff).setBiomeName("chaos", "Chaos").setHumidity(50.0f).setScaling(Scaling.VARYING_CHAOTIC);
public static final Biome chaos = (new BiomeChaos(49)).setColor(0xff00ff).setBiomeName("chaos", "Chaos").setHumidity(0.5F).setHeight(height_VaryingExtreme);
// public static final Biome magmaLands = (new BiomeHell(49, 1)).setColor(16711680).setBiomeName("magmaLands").setRainfall(0.0F).setHeight(height_PartiallySubmerged);
public static final Biome DEF_BIOME = forest; public static final Biome DEF_BIOME = forest;
protected static final PerlinGen TEMP_NOISE; protected static final PerlinGen TEMP_NOISE;
@ -149,7 +127,7 @@ public abstract class Biome
public final int id; public final int id;
protected final WeightedList<Biome.RngSpawn> mobs = new WeightedList<Biome.RngSpawn>(); protected final WeightedList<RngSpawn> mobs = new WeightedList<RngSpawn>();
protected final WorldGenBaseTree worldGeneratorTrees = new WorldGenBaseTree(false); protected final WorldGenBaseTree worldGeneratorTrees = new WorldGenBaseTree(false);
protected final WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false); protected final WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false);
protected final WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp(); protected final WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp();
@ -170,15 +148,15 @@ public abstract class Biome
public int color = 0x000000; public int color = 0x000000;
public State topBlock = Blocks.grass.getState(); public State topBlock = Blocks.grass.getState();
public State fillerBlock = Blocks.dirt.getState(); public State fillerBlock = Blocks.dirt.getState();
public float minHeight = height_Default.rootHeight; public float depth = Scaling.VARYING_LOW.depth;
public float maxHeight = height_Default.variation; public float scale = Scaling.VARYING_LOW.scale;
public float temperature = 0.0F; protected float temperature = 0.0f;
public float humidity = 0.5F; protected float humidity = 50.0f;
public int waterColor = 0xffffff; public int waterColor = 0xffffff;
public boolean generateLakes = true; public boolean generateLakes = true;
public boolean generateLiquids = true; public boolean generateLiquids = true;
public boolean snowyGen = false; public boolean allowColdBeach = false;
public boolean waterGen = false; public boolean disallowBeach = false;
protected int waterlilyPerChunk = 0; protected int waterlilyPerChunk = 0;
protected int treesPerChunk = 0; protected int treesPerChunk = 0;
@ -200,22 +178,22 @@ public abstract class Biome
this.addMobs(this.mobs); this.addMobs(this.mobs);
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new Biome.RngSpawn(EntitySheep.class, 12, 4, 4)); mobs.add(new RngSpawn(EntitySheep.class, 12, 4, 4));
mobs.add(new Biome.RngSpawn(EntityRabbit.class, 10, 3, 10)); mobs.add(new RngSpawn(EntityRabbit.class, 10, 3, 10));
mobs.add(new Biome.RngSpawn(EntityPig.class, 10, 4, 4)); mobs.add(new RngSpawn(EntityPig.class, 10, 4, 4));
mobs.add(new Biome.RngSpawn(EntityChicken.class, 10, 4, 4)); mobs.add(new RngSpawn(EntityChicken.class, 10, 4, 4));
mobs.add(new Biome.RngSpawn(EntityCow.class, 8, 4, 4)); mobs.add(new RngSpawn(EntityCow.class, 8, 4, 4));
mobs.add(new Biome.RngSpawn(EntityArachnoid.class, 100, 4, 4)); mobs.add(new RngSpawn(EntityArachnoid.class, 100, 4, 4));
mobs.add(new Biome.RngSpawn(EntityZombie.class, 100, 4, 4)); mobs.add(new RngSpawn(EntityZombie.class, 100, 4, 4));
mobs.add(new Biome.RngSpawn(EntityUndead.class, 100, 4, 4)); mobs.add(new RngSpawn(EntityUndead.class, 100, 4, 4));
mobs.add(new Biome.RngSpawn(EntityHaunter.class, 100, 4, 4)); mobs.add(new RngSpawn(EntityHaunter.class, 100, 4, 4));
mobs.add(new Biome.RngSpawn(EntitySlime.class, 100, 4, 4)); mobs.add(new RngSpawn(EntitySlime.class, 100, 4, 4));
// mobs.add(new Biome.RngSpawn(EntityEnder....class, 10, 1, 4)); // mobs.add(new Biome.RngSpawn(EntityEnder....class, 10, 1, 4));
mobs.add(new Biome.RngSpawn(EntityMage.class, 5, 1, 1)); mobs.add(new RngSpawn(EntityMage.class, 5, 1, 1));
mobs.add(new Biome.RngSpawn(EntitySquid.class, 10, 4, 4)); mobs.add(new RngSpawn(EntitySquid.class, 10, 4, 4));
mobs.add(new Biome.RngSpawn(EntityBat.class, 10, 8, 8)); mobs.add(new RngSpawn(EntityBat.class, 10, 8, 8));
mobs.add(new Biome.RngSpawn(EntityMouse.class, 10, 8, 8)); mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8));
} }
public int getSkyColor() { public int getSkyColor() {
@ -230,14 +208,15 @@ public abstract class Biome
return 0xffffffff; return 0xffffffff;
} }
protected Biome setTemperatureLegacy(float temperatureIn) // TODO: away, begone!!! public float getFactor() {
{ float f = this.humidity * 0.01f * ((this.temperature + 14.0f) / 40.0f + 0.15f);
return this.setTemperature(((temperatureIn - 0.15f) * 40.0f) - 14.0f); return f > 1.0f ? 1.0f : f;
} }
protected Biome setTemperature(float temperatureIn) // skycolor = ((temp + 14) / 40 + 0.15) / 3
protected Biome setTemperature(float temp)
{ {
this.temperature = temperatureIn; this.temperature = temp;
return this; return this;
} }
@ -247,10 +226,15 @@ public abstract class Biome
return this; return this;
} }
protected final Biome setHeight(Biome.Height heights) protected final Biome setScaling(Scaling scaling)
{ {
this.minHeight = heights.rootHeight; return this.setScaling(scaling.depth, scaling.scale);
this.maxHeight = heights.variation; }
protected final Biome setScaling(float depth, float scale)
{
this.depth = depth;
this.scale = scale;
return this; return this;
} }
@ -279,15 +263,15 @@ public abstract class Biome
return rand.rarity(3) ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.ROSE; return rand.rarity(3) ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.ROSE;
} }
protected Biome setSnowy() protected Biome enableColdBeach()
{ {
this.snowyGen = true; this.allowColdBeach = true;
return this; return this;
} }
protected Biome setWater() protected Biome disableBeach()
{ {
this.waterGen = true; this.disallowBeach = true;
return this; return this;
} }
@ -304,28 +288,22 @@ public abstract class Biome
return this; return this;
} }
public WeightedList<Biome.RngSpawn> getSpawnableList() public WeightedList<RngSpawn> getMobs()
{ {
return this.mobs; return this.mobs;
} }
public boolean isHighHumidity() public boolean isHighHumidity()
{ {
return this.humidity > 0.85F; return this.humidity > 85.0f;
} }
/** public float getMobGenChance()
* returns the chance a creature has to spawn.
*/
public float getSpawningChance()
{ {
return 0.1F; return 0.1F;
} }
/** public final float getTemperature(BlockPos pos)
* Gets a floating point representation of this biome's temperature
*/
public final float getFloatTemperature(BlockPos pos)
{ {
if (pos.getY() > 64) if (pos.getY() > 64)
{ {
@ -575,23 +553,18 @@ public abstract class Biome
public int getGrassColorAtPos(BlockPos pos) public int getGrassColorAtPos(BlockPos pos)
{ {
double d0 = (double)ExtMath.clampf((this.getFloatTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F); double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity, 0.0F, 1.0F); double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getGrassColor(d0, d1); return Colorizer.getGrassColor(d0, d1);
} }
public int getFoliageColorAtPos(BlockPos pos) public int getFoliageColorAtPos(BlockPos pos)
{ {
double d0 = (double)ExtMath.clampf((this.getFloatTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F); double d0 = (double)ExtMath.clampf((this.getTemperature(pos) + 14.0f) / 40.0f + 0.15f, 0.0F, 1.0F);
double d1 = (double)ExtMath.clampf(this.humidity, 0.0F, 1.0F); double d1 = (double)ExtMath.clampf(this.humidity * 0.01f, 0.0F, 1.0F);
return Colorizer.getFoliageColor(d0, d1); return Colorizer.getFoliageColor(d0, d1);
} }
public boolean isSnowyBiome()
{
return this.snowyGen;
}
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
@ -648,7 +621,7 @@ public abstract class Biome
if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
{ {
if (freeze && World.ABSOLUTE_ZERO + worldIn.getTempOffset() + this.getFloatTemperature(blockpos$mutableblockpos.set(x, j1, z)) <= 0.0F) if (freeze && World.ABSOLUTE_ZERO + worldIn.getTempOffset() + this.getTemperature(blockpos$mutableblockpos.set(x, j1, z)) <= 0.0F)
{ {
iblockstate = Blocks.ice.getState(); iblockstate = Blocks.ice.getState();
} }
@ -710,31 +683,26 @@ public abstract class Biome
return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass()); return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass());
} }
public Biome.TempCategory getTempCategory() public Temperature getTempCategory()
{ {
return (double)this.temperature < -12.0 ? Biome.TempCategory.COLD : ((double)this.temperature < 20.0 ? Biome.TempCategory.MEDIUM : Biome.TempCategory.WARM); return this.temperature < -12.0f ? Temperature.COLD : (this.temperature < 20.0f ? Temperature.MEDIUM : Temperature.WARM);
} }
public static Biome[] getBiomeGenArray()
{
return BIOMES;
}
public static Biome getBiome(int id) public static Biome getBiome(int id)
{ {
return getBiomeFromBiomeList(id, null); return getBiome(id, null);
} }
public static Biome getBiomeFromBiomeList(int biomeId, Biome biome) public static Biome getBiome(int id, Biome def)
{ {
if (biomeId >= 0 && biomeId < BIOMES.length) if (id >= 0 && id < BIOMES.length)
{ {
Biome biomegenbase = BIOMES[biomeId]; Biome biome = BIOMES[id];
return biomegenbase == null ? biome : biomegenbase; return biome == null ? def : biome;
} }
else else
{ {
Log.JNI.warn("Biom-ID ist nicht im Bereich: " + biomeId + ", verwende " + DEF_BIOME.id + " (" + DEF_BIOME.name + ")"); Log.JNI.warn("Biom-ID ist nicht im Bereich: " + id + ", verwende " + DEF_BIOME.id + " (" + DEF_BIOME.name + ")");
return DEF_BIOME; return DEF_BIOME;
} }
} }
@ -785,76 +753,19 @@ public abstract class Biome
extremeHills.createMutation(); extremeHills.createMutation();
extremeHillsPlus.createMutation(); extremeHillsPlus.createMutation();
megaTaiga.createMutatedBiome(megaTaigaHills.id + 128).setBiomeName("redwoodTaigaHillsM", "Mammutbaumtaiga"); megaTaiga.createMutatedBiome(megaTaigaHills.id + 128).setBiomeName("redwoodTaigaHillsM", "Mammutbaumtaiga");
for (Biome biomegenbase : BIOMES)
{
if (biomegenbase != null)
{
if (BIOME_ID_MAP.containsKey(biomegenbase.name))
{
throw new Error("Biom \"" + biomegenbase.name + "\" ist als ID " + ((Biome)BIOME_ID_MAP.get(biomegenbase.name)).id + " und " + biomegenbase.id + " definiert");
}
BIOME_ID_MAP.put(biomegenbase.name, biomegenbase);
}
}
TEMP_NOISE = new PerlinGen(new Random(1234L), 1); TEMP_NOISE = new PerlinGen(new Random(1234L), 1);
TREE_NOISE = new PerlinGen(new Random(667L), 8); TREE_NOISE = new PerlinGen(new Random(667L), 8);
GRASS_NOISE = new PerlinGen(new Random(2345L), 1); GRASS_NOISE = new PerlinGen(new Random(2345L), 1);
DOUBLE_PLANT_GEN = new FeatureDoublePlant(); DOUBLE_PLANT_GEN = new FeatureDoublePlant();
for(Biome biome : BIOMES) { for(Biome biome : BIOMES) {
if(biome == null) { if(biome == null)
continue; continue;
} if(LOOKUP.containsKey(biome.name.toLowerCase()))
throw new IllegalStateException("Biom \"" + biome.name + "\" ist als ID " + LOOKUP.get(biome.name.toLowerCase()).id + " und " + biome.id + " definiert");
LOOKUP.put(biome.name.toLowerCase(), biome); LOOKUP.put(biome.name.toLowerCase(), biome);
LIST.add(biome); LIST.add(biome);
} }
} }
public static class Height
{
public float rootHeight;
public float variation;
public Height(float rootHeightIn, float variationIn)
{
this.rootHeight = rootHeightIn;
this.variation = variationIn;
}
public Biome.Height attenuate()
{
return new Biome.Height(this.rootHeight * 0.8F, this.variation * 0.6F);
}
}
public static class RngSpawn extends RngItem
{
public Class <? extends EntityLiving > entityClass;
public int minGroupCount;
public int maxGroupCount;
public RngSpawn(Class <? extends EntityLiving > entityclassIn, int weight, int groupCountMin, int groupCountMax)
{
super(weight);
this.entityClass = entityclassIn;
this.minGroupCount = groupCountMin;
this.maxGroupCount = groupCountMax;
}
// public String toString()
// {
// return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.weight;
// }
}
public static enum TempCategory
{
SEA,
COLD,
MEDIUM,
WARM;
}
} }

View file

@ -16,6 +16,6 @@ public class BiomeBeach extends Biome
this.cactiPerChunk = 0; this.cactiPerChunk = 0;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
} }

View file

@ -0,0 +1,17 @@
package game.biome;
import game.init.Blocks;
import game.rng.WeightedList;
public class BiomeBlackened extends Biome {
public BiomeBlackened(int id) {
super(id);
this.topBlock = Blocks.blackened_soil.getState();
this.fillerBlock = Blocks.blackened_dirt.getState();
this.treesPerChunk = -999;
this.generateLakes = false;
}
protected void addMobs(WeightedList<RngSpawn> mobs) {
}
}

View file

@ -22,7 +22,7 @@ public class BiomeChaos extends Biome
this.fillerBlock = Blocks.obsidian.getState(); this.fillerBlock = Blocks.obsidian.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
for(Class<? extends Entity> clazz : EntityRegistry.getAllClasses()) { for(Class<? extends Entity> clazz : EntityRegistry.getAllClasses()) {
if(EntityLiving.class.isAssignableFrom(clazz)) if(EntityLiving.class.isAssignableFrom(clazz))
mobs.add(new RngSpawn((Class<? extends EntityLiving>)clazz, 1, 1, 8)); mobs.add(new RngSpawn((Class<? extends EntityLiving>)clazz, 1, 1, 8));

View file

@ -21,7 +21,7 @@ public class BiomeDesert extends Biome
this.generateLakes = false; this.generateLakes = false;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(WorldServer worldIn, Random rand, BlockPos pos)

View file

@ -13,7 +13,7 @@ public class BiomeExterminated extends Biome {
this.fillerBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {

View file

@ -65,17 +65,17 @@ public class BiomeForest extends Biome
this.waterlilyPerChunk = 4; this.waterlilyPerChunk = 4;
} }
this.setTemperatureLegacy(0.7F).setHumidity(0.8F); this.setTemperature(8.0f).setHumidity(80.0f);
if (this.subType == 2) if (this.subType == 2)
{ {
this.setColor(3175492); this.setColor(3175492);
this.setTemperatureLegacy(0.6F).setHumidity(0.6F); this.setTemperature(4.0f).setHumidity(60.0f);
} }
if (this.subType == 0) if (this.subType == 0)
{ {
this.mobs.add(new Biome.RngSpawn(EntityWolf.class, 5, 4, 4)); this.mobs.add(new RngSpawn(EntityWolf.class, 5, 4, 4));
} }
if (this.subType == 3) if (this.subType == 3)
@ -84,11 +84,11 @@ public class BiomeForest extends Biome
} }
if(this.subType != 4) { if(this.subType != 4) {
this.mobs.add(new Biome.RngSpawn(EntityWoodElf.class, 3, 2, 6)); this.mobs.add(new RngSpawn(EntityWoodElf.class, 3, 2, 6));
} }
else { else {
this.mobs.add(new Biome.RngSpawn(EntityWoodElf.class, 100, 4, 16)); this.mobs.add(new RngSpawn(EntityWoodElf.class, 100, 4, 16));
this.mobs.add(new Biome.RngSpawn(EntityElf.class, 12, 4, 16)); this.mobs.add(new RngSpawn(EntityElf.class, 12, 4, 16));
} }
} }
@ -205,14 +205,14 @@ public class BiomeForest extends Biome
public int getGrassColorAtPos(BlockPos pos) public int getGrassColorAtPos(BlockPos pos)
{ {
return this.subType == 4 ? Colorizer.getGrassColor(1.0f, this.humidity) : return this.subType == 4 ? Colorizer.getGrassColor(1.0f, this.humidity * 0.01f) :
(this.subType == 3 ? (super.getGrassColorAtPos(pos) & 16711422) + 2634762 >> 1 : (this.subType == 3 ? (super.getGrassColorAtPos(pos) & 16711422) + 2634762 >> 1 :
super.getGrassColorAtPos(pos)); super.getGrassColorAtPos(pos));
} }
public int getFoliageColorAtPos(BlockPos pos) public int getFoliageColorAtPos(BlockPos pos)
{ {
return this.subType == 4 ? Colorizer.getFoliageColor(1.0f, this.humidity) : super.getFoliageColorAtPos(pos); return this.subType == 4 ? Colorizer.getFoliageColor(1.0f, this.humidity * 0.01f) : super.getFoliageColorAtPos(pos);
} }
protected Biome createMutatedBiome(final int id) protected Biome createMutatedBiome(final int id)
@ -220,7 +220,7 @@ public class BiomeForest extends Biome
if (this.id == Biome.forest.id) if (this.id == Biome.forest.id)
{ {
BiomeForest biomegenforest = new BiomeForest(id, 1); BiomeForest biomegenforest = new BiomeForest(id, 1);
biomegenforest.setHeight(new Biome.Height(this.minHeight, this.maxHeight + 0.2F)); biomegenforest.setScaling(this.depth, this.scale + 0.2F);
biomegenforest.setBiomeName("flowerForest", "Blumenwald"); biomegenforest.setBiomeName("flowerForest", "Blumenwald");
biomegenforest.setColor(6976549); biomegenforest.setColor(6976549);
return biomegenforest; return biomegenforest;

View file

@ -34,8 +34,8 @@ public class BiomeHell extends Biome
super(id); super(id);
this.subtype = subtype; this.subtype = subtype;
if(this.subtype == 0) { if(this.subtype == 0) {
this.mobs.add(new Biome.RngSpawn(EntityBloodElf.class, 10, 1, 2)); this.mobs.add(new RngSpawn(EntityBloodElf.class, 10, 1, 2));
this.mobs.add(new Biome.RngSpawn(EntityMetalhead.class, 1, 1, 1)); this.mobs.add(new RngSpawn(EntityMetalhead.class, 1, 1, 1));
this.fireGen = new WorldGenFire(); this.fireGen = new WorldGenFire();
this.glowStoneGen1 = new WorldGenGlowStone(); this.glowStoneGen1 = new WorldGenGlowStone();
this.glowStoneGen2 = new WorldGenGlowStone(); this.glowStoneGen2 = new WorldGenGlowStone();
@ -46,8 +46,8 @@ public class BiomeHell extends Biome
this.redMushroomGen = new WorldGenMushroom(Blocks.red_mushroom); this.redMushroomGen = new WorldGenMushroom(Blocks.red_mushroom);
} }
else { else {
this.mobs.add(new Biome.RngSpawn(EntityBloodElf.class, 50, 2, 10)); this.mobs.add(new RngSpawn(EntityBloodElf.class, 50, 2, 10));
this.mobs.add(new Biome.RngSpawn(EntityCultivator.class, 10, 1, 1)); this.mobs.add(new RngSpawn(EntityCultivator.class, 10, 1, 1));
this.fireGen = null; this.fireGen = null;
this.glowStoneGen1 = null; this.glowStoneGen1 = null;
this.glowStoneGen2 = null; this.glowStoneGen2 = null;
@ -67,10 +67,10 @@ public class BiomeHell extends Biome
} }
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new Biome.RngSpawn(EntityFireDemon.class, 50, 4, 4)); mobs.add(new RngSpawn(EntityFireDemon.class, 50, 4, 4));
mobs.add(new Biome.RngSpawn(EntityTiefling.class, 100, 4, 4)); mobs.add(new RngSpawn(EntityTiefling.class, 100, 4, 4));
mobs.add(new Biome.RngSpawn(EntityMagma.class, 1, 4, 4)); mobs.add(new RngSpawn(EntityMagma.class, 1, 4, 4));
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(WorldServer worldIn, Random rand, BlockPos pos)

View file

@ -91,7 +91,7 @@ public class BiomeHills extends Biome
this.field_150638_aH = this.field_150637_aG; this.field_150638_aH = this.field_150637_aG;
this.setColor(p_150633_1_.color); this.setColor(p_150633_1_.color);
this.setBiomeName(p_150633_1_.name + "M", p_150633_1_.display + " M"); this.setBiomeName(p_150633_1_.name + "M", p_150633_1_.display + " M");
this.setHeight(new Biome.Height(p_150633_1_.minHeight, p_150633_1_.maxHeight)); this.setScaling(p_150633_1_.depth, p_150633_1_.scale);
this.setTemperature(p_150633_1_.temperature); this.setTemperature(p_150633_1_.temperature);
this.setHumidity(p_150633_1_.humidity); this.setHumidity(p_150633_1_.humidity);
return this; return this;

View file

@ -44,10 +44,10 @@ public class BiomeJungle extends Biome
if (!edge) if (!edge)
{ {
this.mobs.add(new Biome.RngSpawn(EntityOcelot.class, 2, 1, 1)); this.mobs.add(new RngSpawn(EntityOcelot.class, 2, 1, 1));
} }
this.mobs.add(new Biome.RngSpawn(EntityChicken.class, 10, 4, 4)); this.mobs.add(new RngSpawn(EntityChicken.class, 10, 4, 4));
} }
public WorldGenTree genBigTreeChance(Random rand) public WorldGenTree genBigTreeChance(Random rand)

View file

@ -36,7 +36,7 @@ public class BiomeMesa extends Biome
this.soil = soil; this.soil = soil;
// this.setDisableRain(); // this.setDisableRain();
// this.setTemperatureLegacy(2.0F).setHumidity(0.0F); // this.setTemperatureLegacy(2.0F).setHumidity(0.0F);
this.setHumidity(0.0F); this.setHumidity(0.0f);
// this.mobs.clear(); // this.mobs.clear();
this.topBlock = Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); this.topBlock = Blocks.sand.getState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND);
this.fillerBlock = Blocks.stained_hardened_clay.getState(); this.fillerBlock = Blocks.stained_hardened_clay.getState();
@ -53,7 +53,7 @@ public class BiomeMesa extends Biome
} }
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public WorldGenTree genBigTreeChance(Random rand) public WorldGenTree genBigTreeChance(Random rand)
@ -334,7 +334,7 @@ public class BiomeMesa extends Biome
if (!bryce) if (!bryce)
{ {
mesa.setHeight(height_LowHills); mesa.setScaling(Scaling.HILLS_LOW);
mesa.setBiomeName(this.name + "M", this.display + " M"); mesa.setBiomeName(this.name + "M", this.display + " M");
} }
else else

View file

@ -16,7 +16,7 @@ public class BiomeMoon extends Biome {
this.fillerBlock = Blocks.moon_rock.getState(); this.fillerBlock = Blocks.moon_rock.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {

View file

@ -17,7 +17,7 @@ public class BiomeMushroom extends Biome
this.topBlock = Blocks.mycelium.getState(); this.topBlock = Blocks.mycelium.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new Biome.RngSpawn(EntityMooshroom.class, 8, 4, 8)); mobs.add(new RngSpawn(EntityMooshroom.class, 8, 4, 8));
} }
} }

View file

@ -25,7 +25,7 @@ public class BiomeMutated extends Biome
this.temperature = biome.temperature; this.temperature = biome.temperature;
this.humidity = biome.humidity; this.humidity = biome.humidity;
this.waterColor = biome.waterColor; this.waterColor = biome.waterColor;
this.snowyGen = biome.snowyGen; this.allowColdBeach = biome.allowColdBeach;
// this.enableRain = biome.enableRain; // this.enableRain = biome.enableRain;
// this.mobs.clear(); // this.mobs.clear();
this.mobs.addAll(biome.mobs); this.mobs.addAll(biome.mobs);
@ -36,11 +36,11 @@ public class BiomeMutated extends Biome
// this.npcs = new WeightedList(biome.npcs); // this.npcs = new WeightedList(biome.npcs);
// this.temperature = biome.temperature; // this.temperature = biome.temperature;
// this.humidity = biome.humidity; // this.humidity = biome.humidity;
this.minHeight = biome.minHeight + 0.1F; this.depth = biome.depth + 0.1F;
this.maxHeight = biome.maxHeight + 0.2F; this.scale = biome.scale + 0.2F;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
@ -58,16 +58,9 @@ public class BiomeMutated extends Biome
this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal); this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
} }
// public AlphaBiome getLegacy() { public float getMobGenChance()
// return this.baseBiome.getLegacy();
// }
/**
* returns the chance a creature has to spawn.
*/
public float getSpawningChance()
{ {
return this.baseBiome.getSpawningChance(); return this.baseBiome.getMobGenChance();
} }
public WorldGenTree genBigTreeChance(Random rand) public WorldGenTree genBigTreeChance(Random rand)
@ -98,7 +91,7 @@ public class BiomeMutated extends Biome
return this.baseBiome.isEqualTo(biome); return this.baseBiome.isEqualTo(biome);
} }
public Biome.TempCategory getTempCategory() public Temperature getTempCategory()
{ {
return this.baseBiome.getTempCategory(); return this.baseBiome.getTempCategory();
} }

View file

@ -14,7 +14,7 @@ public class BiomeNone extends Biome {
this.fillerBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
@ -23,7 +23,7 @@ public class BiomeNone extends Biome {
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(WorldServer worldIn, Random rand, BlockPos pos) {
} }
public Biome.TempCategory getTempCategory() { public Temperature getTempCategory() {
return Biome.TempCategory.SEA; return Temperature.SEA;
} }
} }

View file

@ -23,9 +23,9 @@ public class BiomePlains extends Biome
protected BiomePlains(int id) protected BiomePlains(int id)
{ {
super(id); super(id);
this.setTemperatureLegacy(0.8F).setHumidity(0.4F); this.setTemperature(12.0f).setHumidity(40.0f);
this.setHeight(height_LowPlains); this.setScaling(Scaling.PLAINS_LOW);
this.mobs.add(new Biome.RngSpawn(EntityHorse.class, 5, 2, 6)); this.mobs.add(new RngSpawn(EntityHorse.class, 5, 2, 6));
this.treesPerChunk = -999; this.treesPerChunk = -999;
this.flowersPerChunk = 4; this.flowersPerChunk = 4;
this.grassPerChunk = 10; this.grassPerChunk = 10;

View file

@ -18,7 +18,7 @@ public class BiomeSavanna extends Biome
protected BiomeSavanna(int id) protected BiomeSavanna(int id)
{ {
super(id); super(id);
this.mobs.add(new Biome.RngSpawn(EntityHorse.class, 1, 2, 6)); this.mobs.add(new RngSpawn(EntityHorse.class, 1, 2, 6));
this.treesPerChunk = 1; this.treesPerChunk = 1;
this.flowersPerChunk = 4; this.flowersPerChunk = 4;
this.grassPerChunk = 20; this.grassPerChunk = 20;
@ -33,8 +33,8 @@ public class BiomeSavanna extends Biome
{ {
Biome biomegenbase = new BiomeSavanna.Mutated(p_180277_1_, this); Biome biomegenbase = new BiomeSavanna.Mutated(p_180277_1_, this);
biomegenbase.temperature = this.temperature == 28.0f ? 24.0f : 20.0f; biomegenbase.temperature = this.temperature == 28.0f ? 24.0f : 20.0f;
biomegenbase.minHeight = this.minHeight * 0.5F + 0.3F; biomegenbase.depth = this.depth * 0.5F + 0.3F;
biomegenbase.maxHeight = this.maxHeight * 0.5F + 1.2F; biomegenbase.scale = this.scale * 0.5F + 1.2F;
return biomegenbase; return biomegenbase;
} }

View file

@ -24,7 +24,7 @@ public class BiomeSnow extends Biome
this.topBlock = Blocks.snow.getState(); this.topBlock = Blocks.snow.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
@ -56,9 +56,9 @@ public class BiomeSnow extends Biome
protected Biome createMutatedBiome(int p_180277_1_) protected Biome createMutatedBiome(int p_180277_1_)
{ {
Biome biomegenbase = (new BiomeSnow(p_180277_1_, true)).setColor(13828095).setBiomeName(this.name + "Spikes", this.display + " + Spitzen").setSnowy().setTemperatureLegacy(0.0F).setHumidity(0.5F).setHeight(new Biome.Height(this.minHeight + 0.1F, this.maxHeight + 0.1F)); Biome biomegenbase = (new BiomeSnow(p_180277_1_, true)).setColor(13828095).setBiomeName(this.name + "Spikes", this.display + " + Spitzen").enableColdBeach().setTemperature(-20.0f).setHumidity(50.0f).setScaling(this.depth + 0.1F, this.scale + 0.1F);
biomegenbase.minHeight = this.minHeight + 0.3F; biomegenbase.depth = this.depth + 0.3F;
biomegenbase.maxHeight = this.maxHeight + 0.4F; biomegenbase.scale = this.scale + 0.4F;
return biomegenbase; return biomegenbase;
} }
} }

View file

@ -15,8 +15,8 @@ public class BiomeSnowLand extends Biome
this.mushroomsPerChunk = -1; this.mushroomsPerChunk = -1;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new Biome.RngSpawn(EntitySheep.class, 50, 4, 4)); mobs.add(new RngSpawn(EntitySheep.class, 50, 4, 4));
mobs.add(new Biome.RngSpawn(EntitySpirit.class, 10, 1, 1)); mobs.add(new RngSpawn(EntitySpirit.class, 10, 1, 1));
} }
} }

View file

@ -23,7 +23,7 @@ public class BiomeSpace extends Biome
this.fillerBlock = Blocks.air.getState(); this.fillerBlock = Blocks.air.getState();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(WorldServer worldIn, Random rand, BlockPos pos)

View file

@ -17,6 +17,6 @@ public class BiomeStoneBeach extends Biome
this.cactiPerChunk = 0; this.cactiPerChunk = 0;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
} }

View file

@ -28,8 +28,8 @@ public class BiomeSwamp extends Biome
this.sandPerChunk = 0; this.sandPerChunk = 0;
this.grassPerChunk = 5; this.grassPerChunk = 5;
this.waterColor = 0xe0ffae; this.waterColor = 0xe0ffae;
this.mobs.add(new Biome.RngSpawn(EntitySlime.class, 1, 1, 1)); this.mobs.add(new RngSpawn(EntitySlime.class, 1, 1, 1));
this.setWater(); this.disableBeach();
} }
public WorldGenTree genBigTreeChance(Random rand) public WorldGenTree genBigTreeChance(Random rand)

View file

@ -30,7 +30,7 @@ public class BiomeTaiga extends Biome
{ {
super(id); super(id);
this.field_150644_aH = p_i45385_2_; this.field_150644_aH = p_i45385_2_;
this.mobs.add(new Biome.RngSpawn(EntityWolf.class, 8, 4, 4)); this.mobs.add(new RngSpawn(EntityWolf.class, 8, 4, 4));
this.treesPerChunk = 10; this.treesPerChunk = 10;
if (p_i45385_2_ != 1 && p_i45385_2_ != 2) if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
@ -109,6 +109,6 @@ public class BiomeTaiga extends Biome
protected Biome createMutatedBiome(int p_180277_1_) protected Biome createMutatedBiome(int p_180277_1_)
{ {
return this.id == Biome.megaTaiga.id ? (new BiomeTaiga(p_180277_1_, 2)).setColor(5858897).setBiomeName("megaSpruceTaiga", "Hohe Fichtentaiga").setTemperatureLegacy(0.25F).setHumidity(0.8F).setHeight(new Biome.Height(this.minHeight, this.maxHeight)) : super.createMutatedBiome(p_180277_1_); return this.id == Biome.megaTaiga.id ? (new BiomeTaiga(p_180277_1_, 2)).setColor(5858897).setBiomeName("megaSpruceTaiga", "Hohe Fichtentaiga").setTemperature(-10.0f).setHumidity(80.0f).setScaling(this.depth, this.scale) : super.createMutatedBiome(p_180277_1_);
} }
} }

View file

@ -39,12 +39,12 @@ public class BiomeTian extends Biome
this.treesPerChunk = 1; this.treesPerChunk = 1;
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
// mobs.add(new Biome.RngSpawn(EntityHaunter.class, 50, 4, 4)); // mobs.add(new Biome.RngSpawn(EntityHaunter.class, 50, 4, 4));
mobs.add(new Biome.RngSpawn(EntityCultivator.class, 50, 1, 1)); mobs.add(new RngSpawn(EntityCultivator.class, 50, 1, 1));
mobs.add(new Biome.RngSpawn(EntityRabbit.class, 10, 3, 10)); mobs.add(new RngSpawn(EntityRabbit.class, 10, 3, 10));
mobs.add(new Biome.RngSpawn(EntityBat.class, 10, 8, 8)); mobs.add(new RngSpawn(EntityBat.class, 10, 8, 8));
mobs.add(new Biome.RngSpawn(EntityMouse.class, 10, 8, 8)); mobs.add(new RngSpawn(EntityMouse.class, 10, 8, 8));
} }
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos)

View file

@ -9,14 +9,14 @@ public class BiomeWater extends Biome {
public BiomeWater(int id, boolean river) { public BiomeWater(int id, boolean river) {
super(id); super(id);
this.river = river; this.river = river;
this.setWater(); this.disableBeach();
} }
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
mobs.add(new Biome.RngSpawn(EntitySquid.class, 10, 4, 4)); mobs.add(new RngSpawn(EntitySquid.class, 10, 4, 4));
} }
public Biome.TempCategory getTempCategory() { public Temperature getTempCategory() {
return this.river ? super.getTempCategory() : Biome.TempCategory.SEA; return this.river ? super.getTempCategory() : Temperature.SEA;
} }
} }

View file

@ -0,0 +1,17 @@
package game.biome;
import game.entity.types.EntityLiving;
import game.rng.RngItem;
public class RngSpawn extends RngItem {
public final Class<? extends EntityLiving> type;
public final int min;
public final int max;
public RngSpawn(Class<? extends EntityLiving> type, int weight, int min, int max) {
super(weight);
this.type = type;
this.min = min;
this.max = max;
}
}

View file

@ -0,0 +1,28 @@
package game.biome;
public enum Scaling {
VARYING_LOW(0.1F, 0.2F),
VARYING_MEDIUM(0.1F, 1.0F),
VARYING_CHAOTIC(1.0F, 2.0F),
SEA_VARYING(0.1F, 0.8F),
SEA_SHORE(0.0F, 0.025F),
SEA_POND(-0.2F, 0.1F),
SEA_SHALLOW(-0.5F, 0.0F),
SEA_MEDIUM(-1.0F, 0.1F),
SEA_DEEP(-1.8F, 0.1F),
PLAINS_LOW(0.125F, 0.05F),
PLAINS_MEDIUM(0.2F, 0.2F),
PLAINS_VARYING(0.2F, 0.3F),
HILLS_LOW(0.45F, 0.3F),
HILLS_MEDIUM(0.8F, 0.3F),
HILLS_LARGE(1.0F, 0.5F),
HILLS_PLATEAU(1.5F, 0.025F);
public final float depth;
public final float scale;
private Scaling(float depth, float scale) {
this.depth = depth;
this.scale = scale;
}
}

View file

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

View file

@ -528,9 +528,9 @@ public abstract class UniverseRegistry {
.setBiomeReplacer(Blocks.gravel.getState()) .setBiomeReplacer(Blocks.gravel.getState())
.setBiomeGen(Biome.forest, false, 4, 4, 6, 50, 50, Biome.mushroomPlains).enableMobs().enableSnow() .setBiomeGen(Biome.forest, false, 4, 4, 6, 50, 50, Biome.mushroomPlains).enableMobs().enableSnow()
.setFrostBiomes(Biome.icePlains, Biome.icePlains, Biome.icePlains, Biome.coldTaiga, Biome.megaTaiga) .setFrostBiomes(Biome.icePlains, Biome.icePlains, Biome.icePlains, Biome.coldTaiga, Biome.megaTaiga)
.setColdBiomes(Biome.forest, Biome.extremeHills, Biome.taiga, Biome.plains) .setColdBiomes(Biome.forest, Biome.extremeHills, Biome.taiga, Biome.plains, Biome.blackened)
.setMediumBiomes(Biome.forest, Biome.roofedForest, Biome.extremeHills, Biome.plains, Biome.birchForest, .setMediumBiomes(Biome.forest, Biome.roofedForest, Biome.extremeHills, Biome.plains, Biome.birchForest,
Biome.swampland, Biome.jungle) Biome.swampland, Biome.jungle, Biome.blackened)
.setHotBiomes(Biome.desert, Biome.desert, Biome.desert, Biome.savanna, Biome.savanna, Biome.plains) .setHotBiomes(Biome.desert, Biome.desert, Biome.desert, Biome.savanna, Biome.savanna, Biome.plains)
.enableCavesRavines(Blocks.lava.getState()).setDungeons(8).setWorldFloor(Blocks.bedrock.getState()) .enableCavesRavines(Blocks.lava.getState()).setDungeons(8).setWorldFloor(Blocks.bedrock.getState())
.addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false) .addLake(Blocks.water.getState(), null, Blocks.grass.getState(), 4, 0, 255, false)

View file

@ -1147,7 +1147,7 @@ public class EntityRenderer {
Biome biomegenbase = world.getBiomeGenForCoords(blockpos1); Biome biomegenbase = world.getBiomeGenForCoords(blockpos1);
BlockPos blockpos2 = blockpos1.down(); BlockPos blockpos2 = blockpos1.down();
Block block = world.getState(blockpos2).getBlock(); Block block = world.getState(blockpos2).getBlock();
float temp = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getFloatTemperature(blockpos1); float temp = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getTemperature(blockpos1);
if (blockpos1.getY() <= blockpos.getY() + i && blockpos1.getY() >= blockpos.getY() - i && /* biomegenbase.canRain() && */ temp > 0.0F) if (blockpos1.getY() <= blockpos.getY() + i && blockpos1.getY() >= blockpos.getY() - i && /* biomegenbase.canRain() && */ temp > 0.0F)
{ {
@ -1282,7 +1282,7 @@ public class EntityRenderer {
{ {
this.random.setSeed((long)(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761)); this.random.setSeed((long)(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761));
blockpos$mutableblockpos.set(l1, k2, k1); blockpos$mutableblockpos.set(l1, k2, k1);
float f2 = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getFloatTemperature(blockpos$mutableblockpos); float f2 = World.ABSOLUTE_ZERO + world.getTempOffset() + biomegenbase.getTemperature(blockpos$mutableblockpos);
if(f2 >= 194.0f) if(f2 >= 194.0f)
{ {

View file

@ -5,6 +5,7 @@ import java.util.Set;
import game.collect.Sets; import game.collect.Sets;
import game.biome.Biome; import game.biome.Biome;
import game.biome.RngSpawn;
import game.block.Block; import game.block.Block;
import game.entity.npc.EntityNPC; import game.entity.npc.EntityNPC;
import game.entity.types.EntityLiving; import game.entity.types.EntityLiving;
@ -102,7 +103,7 @@ public abstract class Spawner {
int mx = x; int mx = x;
int my = y; int my = y;
int mz = z; int mz = z;
Biome.RngSpawn entry = null; RngSpawn entry = null;
int cmax = 4; int cmax = 4;
for(int m = 0; m < cmax; ++m) { for(int m = 0; m < cmax; ++m) {
mx += world.rand.zrange(mobSpread) - world.rand.zrange(mobSpread); mx += world.rand.zrange(mobSpread) - world.rand.zrange(mobSpread);
@ -118,13 +119,13 @@ public abstract class Spawner {
if(entry == null) { if(entry == null) {
break; break;
} }
cmax = m + entry.minGroupCount + world.rand.zrange(1 + entry.maxGroupCount - entry.minGroupCount); cmax = m + entry.min + world.rand.zrange(1 + entry.max - entry.min);
} }
if(world.canCreatureTypeSpawnHere(entry, mpos) if(world.canCreatureTypeSpawnHere(entry, mpos)
&& canSpawnAt(EntityWaterMob.class.isAssignableFrom(entry.entityClass), world, mpos)) { && canSpawnAt(EntityWaterMob.class.isAssignableFrom(entry.type), world, mpos)) {
EntityLiving entity; EntityLiving entity;
try { try {
entity = entry.entityClass.getConstructor(World.class).newInstance(world); entity = entry.type.getConstructor(World.class).newInstance(world);
} }
catch(Exception e) { catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -160,15 +161,15 @@ public abstract class Spawner {
public static void generate(WorldServer world, Biome biome, int x, int z, int sx, int sz, Random rand) { public static void generate(WorldServer world, Biome biome, int x, int z, int sx, int sz, Random rand) {
int iters = 0; int iters = 0;
while(rand.floatv() < biome.getSpawningChance()) { while(rand.floatv() < biome.getMobGenChance()) {
if(iters++ == 10) if(iters++ == 10)
break; break;
WeightedList<Biome.RngSpawn> list = biome.getSpawnableList(); WeightedList<RngSpawn> list = biome.getMobs();
if(list.isEmpty()) { if(list.isEmpty()) {
continue; continue;
} }
Biome.RngSpawn entry = list.pick(world.rand); RngSpawn entry = list.pick(world.rand);
int count = entry.minGroupCount + rand.zrange(1 + entry.maxGroupCount - entry.minGroupCount); int count = entry.min + rand.zrange(1 + entry.max - entry.min);
Object data = null; Object data = null;
int mx = x + rand.zrange(sx); int mx = x + rand.zrange(sx);
int mz = z + rand.zrange(sz); int mz = z + rand.zrange(sz);
@ -178,10 +179,10 @@ public abstract class Spawner {
boolean flag = false; boolean flag = false;
for(int m = 0; !flag && m < 4; ++m) { for(int m = 0; !flag && m < 4; ++m) {
BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(mx, 0, mz)); BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(mx, 0, mz));
if(canSpawnAt(EntityWaterMob.class.isAssignableFrom(entry.entityClass), world, pos)) { if(canSpawnAt(EntityWaterMob.class.isAssignableFrom(entry.type), world, pos)) {
EntityLiving entity; EntityLiving entity;
try { try {
entity = entry.entityClass.getConstructor(World.class).newInstance(world); entity = entry.type.getConstructor(World.class).newInstance(world);
} }
catch(Exception e) { catch(Exception e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -1556,7 +1556,7 @@ public abstract class World implements IWorldAccess {
} }
public float getTemperatureK(BlockPos pos) { public float getTemperatureK(BlockPos pos) {
return this.temp + this.getBiomeGenForCoords(pos).getFloatTemperature(pos); return this.temp + this.getBiomeGenForCoords(pos).getTemperature(pos);
} }
public float getTemperatureC(BlockPos pos) { public float getTemperatureC(BlockPos pos) {

View file

@ -764,7 +764,7 @@ public class WorldClient extends World
float mult = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partial) * (float)Math.PI * 2.0F) * 2.0F + 0.5F, float mult = ExtMath.clampf(ExtMath.cos(this.getCelestialAngle(partial) * (float)Math.PI * 2.0F) * 2.0F + 0.5F,
0.0F, 1.0F); 0.0F, 1.0F);
if(this.dimension.getSkyColor() == 0xffffffff) { if(this.dimension.getSkyColor() == 0xffffffff) {
float temp = ExtMath.clampf(((biome.getFloatTemperature(pos) + 14.0f) / 40.0f + 0.15f) / 3.0F, float temp = ExtMath.clampf(((biome.getTemperature(pos) + 14.0f) / 40.0f + 0.15f) / 3.0F,
-1.0F, 1.0F); -1.0F, 1.0F);
Vec3 sky = new Vec3(hsvToRGB(0.62222224F - temp * 0.05F, 0.5F + temp * 0.1F, 1.0F)); Vec3 sky = new Vec3(hsvToRGB(0.62222224F - temp * 0.05F, 0.5F + temp * 0.1F, 1.0F));
vec = new Vec3(vec.xCoord * sky.xCoord * mult, vec.yCoord * sky.yCoord * mult, vec.zCoord * sky.zCoord * mult); vec = new Vec3(vec.xCoord * sky.xCoord * mult, vec.yCoord * sky.yCoord * mult, vec.zCoord * sky.zCoord * mult);

View file

@ -19,6 +19,7 @@ import game.collect.Sets;
import game.Server; import game.Server;
import game.biome.Biome; import game.biome.Biome;
import game.biome.RngSpawn;
import game.block.Block; import game.block.Block;
import game.block.BlockDoor; import game.block.BlockDoor;
import game.block.BlockEventData; import game.block.BlockEventData;
@ -465,23 +466,23 @@ public final class WorldServer extends World {
return true; return true;
} }
private WeightedList<Biome.RngSpawn> getSpawnTypes(BlockPos pos) { private WeightedList<RngSpawn> getSpawnTypes(BlockPos pos) {
Biome biome = this.getBiomeGenForCoords(pos); Biome biome = this.getBiomeGenForCoords(pos);
if(this.bridgeGen != null && (this.bridgeGen.isPresent(pos) if(this.bridgeGen != null && (this.bridgeGen.isPresent(pos)
|| (this.bridgeGen.isPositionInStructure(this, pos) && this.getState(pos.down()).getBlock() == Blocks.blood_brick))) || (this.bridgeGen.isPositionInStructure(this, pos) && this.getState(pos.down()).getBlock() == Blocks.blood_brick)))
return LootConstants.FORTRESS_MOBS; return LootConstants.FORTRESS_MOBS;
else if(this.scatteredGen != null && this.scatteredGen.hasMageHut(pos)) else if(this.scatteredGen != null && this.scatteredGen.hasMageHut(pos))
return LootConstants.MAGEHUT_MOBS; return LootConstants.MAGEHUT_MOBS;
return biome.getSpawnableList(); return biome.getMobs();
} }
public Biome.RngSpawn getSpawnListEntryForTypeAt(BlockPos pos) { public RngSpawn getSpawnListEntryForTypeAt(BlockPos pos) {
WeightedList<Biome.RngSpawn> list = this.getSpawnTypes(pos); WeightedList<RngSpawn> list = this.getSpawnTypes(pos);
return list != null && !list.isEmpty() ? (Biome.RngSpawn)list.pick(this.rand) : null; return list != null && !list.isEmpty() ? (RngSpawn)list.pick(this.rand) : null;
} }
public boolean canCreatureTypeSpawnHere(Biome.RngSpawn spawnListEntry, BlockPos pos) { public boolean canCreatureTypeSpawnHere(RngSpawn spawnListEntry, BlockPos pos) {
WeightedList<Biome.RngSpawn> list = this.getSpawnTypes(pos); WeightedList<RngSpawn> list = this.getSpawnTypes(pos);
return list != null && !list.isEmpty() ? list.contains(spawnListEntry) : false; return list != null && !list.isEmpty() ? list.contains(spawnListEntry) : false;
} }

View file

@ -176,18 +176,15 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
for(int i = 0; i < width * length; ++i) { for(int i = 0; i < width * length; ++i) {
Biome biome = Biome.getBiomeFromBiomeList(aint[i], Biome.DEF_BIOME); Biome biome = Biome.getBiome(aint[i], Biome.DEF_BIOME);
float f = biome.humidity * biome.temperature; listToReuse[i] = (double)biome.getFactor();
if(f > 1.0F)
f = 1.0F;
listToReuse[i] = (double)f;
} }
} }
public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ) { public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ) {
IntCache.resetIntCache(); IntCache.resetIntCache();
if(true && sizeX == 16 && sizeZ == 16 && (xPos & 15) == 0 && (zPos & 15) == 0) { if(sizeX == 16 && sizeZ == 16 && (xPos & 15) == 0 && (zPos & 15) == 0) {
double[] cachedFacts = this.getBiomeCacheBlock(xPos, zPos).factors; double[] cachedFacts = this.getBiomeCacheBlock(xPos, zPos).factors;
System.arraycopy(cachedFacts, 0, factors, 0, sizeX * sizeZ); System.arraycopy(cachedFacts, 0, factors, 0, sizeX * sizeZ);
} }
@ -195,11 +192,8 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.biomeIndexLayer.getInts(xPos, zPos, sizeX, sizeZ); int[] aint = this.biomeIndexLayer.getInts(xPos, zPos, sizeX, sizeZ);
for(int i = 0; i < sizeX * sizeZ; ++i) { for(int i = 0; i < sizeX * sizeZ; ++i) {
Biome biome = Biome.getBiomeFromBiomeList(aint[i], Biome.DEF_BIOME); Biome biome = Biome.getBiome(aint[i], Biome.DEF_BIOME);
float f = biome.humidity * biome.temperature; factors[i] = (double)biome.getFactor();
if(f > 1.0F)
f = 1.0F;
factors[i] = (double)f;
} }
} }
} }
@ -210,7 +204,7 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.genBiomes.getInts(x, z, width, height); int[] aint = this.genBiomes.getInts(x, z, width, height);
for(int i = 0; i < width * height; ++i) { for(int i = 0; i < width * height; ++i) {
biomes[i] = Biome.getBiomeFromBiomeList(aint[i], Biome.DEF_BIOME); biomes[i] = Biome.getBiome(aint[i], Biome.DEF_BIOME);
} }
} }
@ -229,7 +223,7 @@ public class BiomeGenLayered implements BiomeGenerator {
int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
for(int i = 0; i < width * length; ++i) { for(int i = 0; i < width * length; ++i) {
listToReuse[i] = Biome.getBiomeFromBiomeList(aint[i], Biome.DEF_BIOME); listToReuse[i] = Biome.getBiome(aint[i], Biome.DEF_BIOME);
} }
} }
} }

View file

@ -42,6 +42,6 @@ public class BiomeGenSingle implements BiomeGenerator {
} }
public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ) { public void genFactors(double[] factors, int xPos, int zPos, int sizeX, int sizeZ) {
Arrays.fill(factors, 0, sizeX * sizeZ, this.biome.humidity * this.biome.temperature); Arrays.fill(factors, 0, sizeX * sizeZ, this.biome.getFactor());
} }
} }

View file

@ -203,8 +203,8 @@ public class GeneratorPerlin implements ChunkGenerator
for (int b = -range; b <= range; ++b) for (int b = -range; b <= range; ++b)
{ {
Biome biome2 = this.biomes[u + a + 2 + (v + b + 2) * 10]; Biome biome2 = this.biomes[u + a + 2 + (v + b + 2) * 10];
float bmin = this.biomeDepthOffset + biome2.minHeight * this.biomeDepthWeight; float bmin = this.biomeDepthOffset + biome2.depth * this.biomeDepthWeight;
float bmax = this.biomeScaleOffset + biome2.maxHeight * this.biomeScaleWeight; float bmax = this.biomeScaleOffset + biome2.scale * this.biomeScaleWeight;
if (this.amplification > 0.0F && bmin > 0.0F) if (this.amplification > 0.0F && bmin > 0.0F)
{ {
@ -214,7 +214,7 @@ public class GeneratorPerlin implements ChunkGenerator
float fact = PARABOLIC[a + 2 + (b + 2) * 5] / (bmin + 2.0F); float fact = PARABOLIC[a + 2 + (b + 2) * 5] / (bmin + 2.0F);
if (biome2.minHeight > biome.minHeight) if (biome2.depth > biome.depth)
{ {
fact /= 2.0F; fact /= 2.0F;
} }

View file

@ -1,6 +1,6 @@
package game.worldgen; package game.worldgen;
import game.biome.Biome; import game.biome.RngSpawn;
import game.color.DyeColor; import game.color.DyeColor;
import game.entity.npc.EntityDarkMage; import game.entity.npc.EntityDarkMage;
import game.entity.npc.EntityMage; import game.entity.npc.EntityMage;
@ -95,8 +95,8 @@ public abstract class LootConstants {
new RngLoot(Items.wood_axe, 0, 1, 1, 5), new RngLoot(Items.stone_pickaxe, 0, 1, 1, 3), new RngLoot(Items.wood_pickaxe, 0, 1, 1, 5), new RngLoot(Items.wood_axe, 0, 1, 1, 5), new RngLoot(Items.stone_pickaxe, 0, 1, 1, 3), new RngLoot(Items.wood_pickaxe, 0, 1, 1, 5),
new RngLoot(Items.apple, 0, 2, 3, 5), new RngLoot(Items.bread, 0, 2, 3, 3), new RngLoot(Items.apple, 0, 2, 3, 5), new RngLoot(Items.bread, 0, 2, 3, 3),
new RngLoot(ItemRegistry.getItemFromBlock(Blocks.acacia_log), 0, 1, 3, 10)); new RngLoot(ItemRegistry.getItemFromBlock(Blocks.acacia_log), 0, 1, 3, 10));
public static final WeightedList<Biome.RngSpawn> MAGEHUT_MOBS = new WeightedList<Biome.RngSpawn>(new Biome.RngSpawn(EntityMage.class, 1, 1, 1)); public static final WeightedList<RngSpawn> MAGEHUT_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityMage.class, 1, 1, 1));
public static final WeightedList<Biome.RngSpawn> FORTRESS_MOBS = new WeightedList<Biome.RngSpawn>(new Biome.RngSpawn(EntityDarkMage.class, 10, 2, 3), public static final WeightedList<RngSpawn> FORTRESS_MOBS = new WeightedList<RngSpawn>(new RngSpawn(EntityDarkMage.class, 10, 2, 3),
new Biome.RngSpawn(EntityTiefling.class, 5, 4, 4), new Biome.RngSpawn(EntityUndead.class, 10, 4, 4), new RngSpawn(EntityTiefling.class, 5, 4, 4), new RngSpawn(EntityUndead.class, 10, 4, 4),
new Biome.RngSpawn(EntityMagma.class, 3, 4, 4)); new RngSpawn(EntityMagma.class, 3, 4, 4));
} }

View file

@ -1,6 +1,7 @@
package game.worldgen.layer; package game.worldgen.layer;
import game.biome.Biome; import game.biome.Biome;
import game.biome.Temperature;
public class GenLayerBiomeEdge extends GenLayer public class GenLayerBiomeEdge extends GenLayer
{ {
@ -153,9 +154,9 @@ public class GenLayerBiomeEdge extends GenLayer
if (biomegenbase != null && biomegenbase1 != null) if (biomegenbase != null && biomegenbase1 != null)
{ {
Biome.TempCategory biomegenbase$tempcategory = biomegenbase.getTempCategory(); Temperature biomegenbase$tempcategory = biomegenbase.getTempCategory();
Biome.TempCategory biomegenbase$tempcategory1 = biomegenbase1.getTempCategory(); Temperature biomegenbase$tempcategory1 = biomegenbase1.getTempCategory();
return biomegenbase$tempcategory == biomegenbase$tempcategory1 || biomegenbase$tempcategory == Biome.TempCategory.MEDIUM || biomegenbase$tempcategory1 == Biome.TempCategory.MEDIUM; return biomegenbase$tempcategory == biomegenbase$tempcategory1 || biomegenbase$tempcategory == Temperature.MEDIUM || biomegenbase$tempcategory1 == Temperature.MEDIUM;
} }
else else
{ {

View file

@ -66,13 +66,13 @@ public class GenLayerShore extends GenLayer
} }
else if (id != Biome.extremeHills.id && id != Biome.extremeHillsPlus.id && id != Biome.extremeHillsEdge.id) else if (id != Biome.extremeHills.id && id != Biome.extremeHillsPlus.id && id != Biome.extremeHillsEdge.id)
{ {
if (biome != null && biome.snowyGen) if (biome != null && biome.allowColdBeach)
{ {
this.putBeach(pre, data, j, i, width, id, Biome.coldBeach.id); this.putBeach(pre, data, j, i, width, id, Biome.coldBeach.id);
} }
else // if (id != Biome.mesa.id && id != Biome.mesaPlateau_F.id) else // if (id != Biome.mesa.id && id != Biome.mesaPlateau_F.id)
// { // {
if (biome != null && !biome.waterGen) if (biome != null && !biome.disallowBeach)
{ {
int l1 = pre[j + 1 + (i + 1 - 1) * (width + 2)]; int l1 = pre[j + 1 + (i + 1 - 1) * (width + 2)];
int k2 = pre[j + 1 + 1 + (i + 1) * (width + 2)]; int k2 = pre[j + 1 + 1 + (i + 1) * (width + 2)];