| 1 | package net.minecraft.world.biome;
|
| 2 |
|
| 3 | import java.util.Random;
|
| 4 | import net.minecraft.block.BlockLeaves;
|
| 5 | import net.minecraft.block.BlockOldLeaf;
|
| 6 | import net.minecraft.block.BlockOldLog;
|
| 7 | import net.minecraft.block.BlockPlanks;
|
| 8 | import net.minecraft.block.BlockTallGrass;
|
| 9 | import net.minecraft.block.state.IBlockState;
|
| 10 | import net.minecraft.entity.passive.EntityChicken;
|
| 11 | import net.minecraft.entity.passive.EntityOcelot;
|
| 12 | import net.minecraft.init.Blocks;
|
| 13 | import net.minecraft.util.BlockPos;
|
| 14 | import net.minecraft.world.World;
|
| 15 | import net.minecraft.world.gen.feature.WorldGenAbstractTree;
|
| 16 | import net.minecraft.world.gen.feature.WorldGenMegaJungle;
|
| 17 | import net.minecraft.world.gen.feature.WorldGenMelon;
|
| 18 | import net.minecraft.world.gen.feature.WorldGenShrub;
|
| 19 | import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
| 20 | import net.minecraft.world.gen.feature.WorldGenTrees;
|
| 21 | import net.minecraft.world.gen.feature.WorldGenVines;
|
| 22 | import net.minecraft.world.gen.feature.WorldGenerator;
|
| 23 |
|
| 24 | public class BiomeGenJungle extends BiomeGenBase
|
| 25 | {
|
| 26 | private boolean field_150614_aC;
|
| 27 | private static final IBlockState field_181620_aE = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
|
| 28 | private static final IBlockState field_181621_aF = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
| 29 | private static final IBlockState field_181622_aG = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
| 30 |
|
| 31 | public BiomeGenJungle(int id, boolean p_i45379_2_)
|
| 32 | {
|
| 33 | super(id);
|
| 34 | this.field_150614_aC = p_i45379_2_;
|
| 35 |
|
| 36 | if (p_i45379_2_)
|
| 37 | {
|
| 38 | this.theBiomeDecorator.treesPerChunk = 2;
|
| 39 | }
|
| 40 | else
|
| 41 | {
|
| 42 | this.theBiomeDecorator.treesPerChunk = 50;
|
| 43 | }
|
| 44 |
|
| 45 | this.theBiomeDecorator.grassPerChunk = 25;
|
| 46 | this.theBiomeDecorator.flowersPerChunk = 4;
|
| 47 |
|
| 48 | if (!p_i45379_2_)
|
| 49 | {
|
| 50 | this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
| 51 | }
|
| 52 |
|
| 53 | this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
|
| 54 | }
|
| 55 |
|
| 56 | public WorldGenAbstractTree genBigTreeChance(Random rand)
|
| 57 | {
|
| 58 | return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : (rand.nextInt(2) == 0 ? new WorldGenShrub(field_181620_aE, field_181622_aG) : (!this.field_150614_aC && rand.nextInt(3) == 0 ? new WorldGenMegaJungle(false, 10, 20, field_181620_aE, field_181621_aF) : new WorldGenTrees(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true))));
|
| 59 | }
|
| 60 |
|
| 61 | /**
|
| 62 | * Gets a WorldGen appropriate for this biome.
|
| 63 | */
|
| 64 | public WorldGenerator getRandomWorldGenForGrass(Random rand)
|
| 65 | {
|
| 66 | return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
|
| 67 | }
|
| 68 |
|
| 69 | public void decorate(World worldIn, Random rand, BlockPos pos)
|
| 70 | {
|
| 71 | super.decorate(worldIn, rand, pos);
|
| 72 | int i = rand.nextInt(16) + 8;
|
| 73 | int j = rand.nextInt(16) + 8;
|
| 74 | int k = rand.nextInt(worldIn.getHeight(pos.add(i, 0, j)).getY() * 2);
|
| 75 | (new WorldGenMelon()).generate(worldIn, rand, pos.add(i, k, j));
|
| 76 | WorldGenVines worldgenvines = new WorldGenVines();
|
| 77 |
|
| 78 | for (j = 0; j < 50; ++j)
|
| 79 | {
|
| 80 | k = rand.nextInt(16) + 8;
|
| 81 | int l = 128;
|
| 82 | int i1 = rand.nextInt(16) + 8;
|
| 83 | worldgenvines.generate(worldIn, rand, pos.add(k, 128, i1));
|
| 84 | }
|
| 85 | }
|
| 86 | }
|
| 87 |
|