90 lines
2.8 KiB
Java
90 lines
2.8 KiB
Java
![]() |
package game.biome;
|
||
|
|
||
|
import game.block.BlockDirt;
|
||
|
import game.block.BlockDoublePlant;
|
||
|
import game.entity.animal.EntityHorse;
|
||
|
import game.init.Blocks;
|
||
|
import game.rng.Random;
|
||
|
import game.world.BlockPos;
|
||
|
import game.world.WorldServer;
|
||
|
import game.worldgen.ChunkPrimer;
|
||
|
import game.worldgen.tree.WorldGenSavanna;
|
||
|
import game.worldgen.tree.WorldGenTree;
|
||
|
|
||
|
public class BiomeSavanna extends Biome
|
||
|
{
|
||
|
private static final WorldGenSavanna field_150627_aC = new WorldGenSavanna(false);
|
||
|
|
||
|
protected BiomeSavanna(int id)
|
||
|
{
|
||
|
super(id);
|
||
|
this.mobs.add(new Biome.RngSpawn(EntityHorse.class, 1, 2, 6));
|
||
|
this.treesPerChunk = 1;
|
||
|
this.flowersPerChunk = 4;
|
||
|
this.grassPerChunk = 20;
|
||
|
}
|
||
|
|
||
|
public WorldGenTree genBigTreeChance(Random rand)
|
||
|
{
|
||
|
return (WorldGenTree)(rand.rarity(5) ? field_150627_aC : this.worldGeneratorTrees);
|
||
|
}
|
||
|
|
||
|
protected Biome createMutatedBiome(int p_180277_1_)
|
||
|
{
|
||
|
Biome biomegenbase = new BiomeSavanna.Mutated(p_180277_1_, this);
|
||
|
biomegenbase.temperature = this.temperature == 28.0f ? 24.0f : 20.0f;
|
||
|
biomegenbase.minHeight = this.minHeight * 0.5F + 0.3F;
|
||
|
biomegenbase.maxHeight = this.maxHeight * 0.5F + 1.2F;
|
||
|
return biomegenbase;
|
||
|
}
|
||
|
|
||
|
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
|
||
|
{
|
||
|
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
|
||
|
|
||
|
for (int i = 0; i < 7; ++i)
|
||
|
{
|
||
|
int j = rand.chOffset();
|
||
|
int k = rand.chOffset();
|
||
|
int l = rand.zrange(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
|
||
|
DOUBLE_PLANT_GEN.generate(worldIn, rand, pos.add(j, l, k));
|
||
|
}
|
||
|
|
||
|
super.decorate(worldIn, rand, pos);
|
||
|
}
|
||
|
|
||
|
public static class Mutated extends BiomeMutated
|
||
|
{
|
||
|
public Mutated(int p_i45382_1_, Biome p_i45382_2_)
|
||
|
{
|
||
|
super(p_i45382_1_, p_i45382_2_);
|
||
|
this.treesPerChunk = 2;
|
||
|
this.flowersPerChunk = 2;
|
||
|
this.grassPerChunk = 5;
|
||
|
}
|
||
|
|
||
|
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
|
||
|
{
|
||
|
this.topBlock = Blocks.grass.getState();
|
||
|
this.fillerBlock = Blocks.dirt.getState();
|
||
|
|
||
|
if (noiseVal > 1.75D)
|
||
|
{
|
||
|
this.topBlock = Blocks.stone.getState();
|
||
|
this.fillerBlock = Blocks.stone.getState();
|
||
|
}
|
||
|
else if (noiseVal > -0.5D)
|
||
|
{
|
||
|
this.topBlock = Blocks.dirt.getState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
|
||
|
}
|
||
|
|
||
|
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
|
||
|
}
|
||
|
|
||
|
public void decorate(WorldServer worldIn, Random rand, BlockPos pos)
|
||
|
{
|
||
|
this.decorateNormal(worldIn, rand, pos);
|
||
|
}
|
||
|
}
|
||
|
}
|