tcr/java/src/game/biome/BiomeSnow.java

65 lines
2 KiB
Java
Raw Normal View History

2025-03-11 00:23:54 +01:00
package game.biome;
import game.init.Blocks;
import game.rng.Random;
import game.rng.WeightedList;
import game.world.BlockPos;
import game.world.WorldServer;
import game.worldgen.feature.WorldGenIcePath;
import game.worldgen.feature.WorldGenIceSpike;
import game.worldgen.tree.WorldGenTaiga2;
import game.worldgen.tree.WorldGenTree;
public class BiomeSnow extends Biome
{
private final WorldGenIceSpike spikeGen = new WorldGenIceSpike();
private final WorldGenIcePath pathGen = new WorldGenIcePath(4);
private final boolean spiky;
public BiomeSnow(int id, boolean spiky)
{
super(id);
this.spiky = spiky;
if(spiky)
this.topBlock = Blocks.snow.getState();
}
protected void addMobs(WeightedList<Biome.RngSpawn> mobs) {
}
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
{
if (this.spiky)
{
for (int i = 0; i < 3; ++i)
{
int j = rand.chOffset();
int k = rand.chOffset();
this.spikeGen.generate(worldIn, rand, worldIn.getHeight(pos.add(j, 0, k)));
}
for (int l = 0; l < 2; ++l)
{
int i1 = rand.chOffset();
int j1 = rand.chOffset();
this.pathGen.generate(worldIn, rand, worldIn.getHeight(pos.add(i1, 0, j1)));
}
}
super.decorate(worldIn, rand, pos);
}
public WorldGenTree genBigTreeChance(Random rand)
{
return new WorldGenTaiga2(false);
}
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));
biomegenbase.minHeight = this.minHeight + 0.3F;
biomegenbase.maxHeight = this.maxHeight + 0.4F;
return biomegenbase;
}
}