64 lines
2 KiB
Java
Executable file
64 lines
2 KiB
Java
Executable file
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<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").enableColdBeach().setTemperature(-20.0f).setHumidity(50.0f).setScaling(this.depth + 0.1F, this.scale + 0.1F);
|
|
biomegenbase.depth = this.depth + 0.3F;
|
|
biomegenbase.scale = this.scale + 0.4F;
|
|
return biomegenbase;
|
|
}
|
|
}
|