| 1 | package net.minecraft.world.biome;
|
| 2 |
|
| 3 | import java.util.Random;
|
| 4 | import net.minecraft.block.BlockDirt;
|
| 5 | import net.minecraft.block.BlockDoublePlant;
|
| 6 | import net.minecraft.block.BlockTallGrass;
|
| 7 | import net.minecraft.entity.passive.EntityWolf;
|
| 8 | import net.minecraft.init.Blocks;
|
| 9 | import net.minecraft.util.BlockPos;
|
| 10 | import net.minecraft.world.World;
|
| 11 | import net.minecraft.world.chunk.ChunkPrimer;
|
| 12 | import net.minecraft.world.gen.feature.WorldGenAbstractTree;
|
| 13 | import net.minecraft.world.gen.feature.WorldGenBlockBlob;
|
| 14 | import net.minecraft.world.gen.feature.WorldGenMegaPineTree;
|
| 15 | import net.minecraft.world.gen.feature.WorldGenTaiga1;
|
| 16 | import net.minecraft.world.gen.feature.WorldGenTaiga2;
|
| 17 | import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
| 18 | import net.minecraft.world.gen.feature.WorldGenerator;
|
| 19 |
|
| 20 | public class BiomeGenTaiga extends BiomeGenBase
|
| 21 | {
|
| 22 | private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1();
|
| 23 | private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false);
|
| 24 | private static final WorldGenMegaPineTree field_150641_aE = new WorldGenMegaPineTree(false, false);
|
| 25 | private static final WorldGenMegaPineTree field_150642_aF = new WorldGenMegaPineTree(false, true);
|
| 26 | private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0);
|
| 27 | private int field_150644_aH;
|
| 28 |
|
| 29 | public BiomeGenTaiga(int id, int p_i45385_2_)
|
| 30 | {
|
| 31 | super(id);
|
| 32 | this.field_150644_aH = p_i45385_2_;
|
| 33 | this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
|
| 34 | this.theBiomeDecorator.treesPerChunk = 10;
|
| 35 |
|
| 36 | if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
|
| 37 | {
|
| 38 | this.theBiomeDecorator.grassPerChunk = 1;
|
| 39 | this.theBiomeDecorator.mushroomsPerChunk = 1;
|
| 40 | }
|
| 41 | else
|
| 42 | {
|
| 43 | this.theBiomeDecorator.grassPerChunk = 7;
|
| 44 | this.theBiomeDecorator.deadBushPerChunk = 1;
|
| 45 | this.theBiomeDecorator.mushroomsPerChunk = 3;
|
| 46 | }
|
| 47 | }
|
| 48 |
|
| 49 | public WorldGenAbstractTree genBigTreeChance(Random rand)
|
| 50 | {
|
| 51 | return (WorldGenAbstractTree)((this.field_150644_aH == 1 || this.field_150644_aH == 2) && rand.nextInt(3) == 0 ? (this.field_150644_aH != 2 && rand.nextInt(13) != 0 ? field_150641_aE : field_150642_aF) : (rand.nextInt(3) == 0 ? field_150639_aC : field_150640_aD));
|
| 52 | }
|
| 53 |
|
| 54 | /**
|
| 55 | * Gets a WorldGen appropriate for this biome.
|
| 56 | */
|
| 57 | public WorldGenerator getRandomWorldGenForGrass(Random rand)
|
| 58 | {
|
| 59 | return rand.nextInt(5) > 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
|
| 60 | }
|
| 61 |
|
| 62 | public void decorate(World worldIn, Random rand, BlockPos pos)
|
| 63 | {
|
| 64 | if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
|
| 65 | {
|
| 66 | int i = rand.nextInt(3);
|
| 67 |
|
| 68 | for (int j = 0; j < i; ++j)
|
| 69 | {
|
| 70 | int k = rand.nextInt(16) + 8;
|
| 71 | int l = rand.nextInt(16) + 8;
|
| 72 | BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
|
| 73 | field_150643_aG.generate(worldIn, rand, blockpos);
|
| 74 | }
|
| 75 | }
|
| 76 |
|
| 77 | DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);
|
| 78 |
|
| 79 | for (int i1 = 0; i1 < 7; ++i1)
|
| 80 | {
|
| 81 | int j1 = rand.nextInt(16) + 8;
|
| 82 | int k1 = rand.nextInt(16) + 8;
|
| 83 | int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
|
| 84 | DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
|
| 85 | }
|
| 86 |
|
| 87 | super.decorate(worldIn, rand, pos);
|
| 88 | }
|
| 89 |
|
| 90 | public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
|
| 91 | {
|
| 92 | if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
|
| 93 | {
|
| 94 | this.topBlock = Blocks.grass.getDefaultState();
|
| 95 | this.fillerBlock = Blocks.dirt.getDefaultState();
|
| 96 |
|
| 97 | if (noiseVal > 1.75D)
|
| 98 | {
|
| 99 | this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
|
| 100 | }
|
| 101 | else if (noiseVal > -0.95D)
|
| 102 | {
|
| 103 | this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
|
| 104 | }
|
| 105 | }
|
| 106 |
|
| 107 | this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
|
| 108 | }
|
| 109 |
|
| 110 | protected BiomeGenBase createMutatedBiome(int p_180277_1_)
|
| 111 | {
|
| 112 | return this.biomeID == BiomeGenBase.megaTaiga.biomeID ? (new BiomeGenTaiga(p_180277_1_, 2)).func_150557_a(5858897, true).setBiomeName("Mega Spruce Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight)) : super.createMutatedBiome(p_180277_1_);
|
| 113 | }
|
| 114 | }
|
| 115 |
|