@Override protected void generateOres() { MinecraftForge.ORE_GEN_BUS.post( new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) this.genStandardOre1(20, this.dirtGen, 0, 256); if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL)) this.genStandardOre1(10, this.gravelGen, 0, 256); MinecraftForge.ORE_GEN_BUS.post( new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); }
@Override public void func_149878_d(World world, int x, int y, int z, Random rand) { if (world.isRemote || !TerrainGen.saplingGrowTree(world, rand, x, y, z)) return; int meta = damageDropped(world.getBlockMetadata(x, y, z)); world.setBlockToAir(x, y, z); switch (meta) { case 1: if (MineFactoryReloadedWorldGen.generateSacredSpringRubberTree(world, rand, x, y, z)) return; break; case 2: if (MineFactoryReloadedWorldGen.generateMegaRubberTree(world, rand, x, y, z, false)) return; break; case 3: if (new WorldGenMassiveTree().setSloped(true).generate(world, rand, x, y, z)) return; break; default: case 0: BiomeGenBase b = world.getBiomeGenForCoords(x, z); if (b != null && b.biomeName.toLowerCase().contains("mega")) if (rand.nextInt(50) == 0) if (MineFactoryReloadedWorldGen.generateMegaRubberTree(world, rand, x, y, z, true)) return; if (treeGen.growTree(world, rand, x, y, z)) return; break; } world.setBlock(x, y, z, this, meta, 4); }
public void decorateHives( IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) { if (!TerrainGen.populate( chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated, EVENT_TYPE)) { return; } decorateHives(world, rand, chunkX, chunkZ); }
/** * This method should be called if both of the following conditions are true: * * <p>1) You are manually decorating a biome by overrding rDecorate(). 2) You are NOT calling * rDecorateSeedBiome() within rDecorate(). */ public void rOreGenSeedBiome( World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, BiomeGenBase seedBiome) { MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(world, rand, chunkX, chunkY)); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.dirtGen, chunkX, chunkY, DIRT)) genStandardOre1(20, seedBiome.theBiomeDecorator.dirtGen, 0, 256, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.gravelGen, chunkX, chunkY, GRAVEL)) genStandardOre1( 10, seedBiome.theBiomeDecorator.gravelGen, 0, 256, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.coalGen, chunkX, chunkY, COAL)) genStandardOre1(20, seedBiome.theBiomeDecorator.coalGen, 0, 128, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.ironGen, chunkX, chunkY, IRON)) genStandardOre1(20, seedBiome.theBiomeDecorator.ironGen, 0, 64, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.goldGen, chunkX, chunkY, GOLD)) genStandardOre1(2, seedBiome.theBiomeDecorator.goldGen, 0, 32, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.redstoneGen, chunkX, chunkY, REDSTONE)) genStandardOre1( 8, seedBiome.theBiomeDecorator.redstoneGen, 0, 16, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.diamondGen, chunkX, chunkY, DIAMOND)) genStandardOre1( 1, seedBiome.theBiomeDecorator.diamondGen, 0, 16, world, rand, chunkX, chunkY); if (TerrainGen.generateOre( world, rand, seedBiome.theBiomeDecorator.lapisGen, chunkX, chunkY, LAPIS)) genStandardOre2(1, seedBiome.theBiomeDecorator.lapisGen, 16, 16, world, rand, chunkX, chunkY); if (ConfigRTG.generateOreEmerald && generatesEmeralds) { rGenerateEmeralds(world, rand, chunkX, chunkY); } MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(world, rand, chunkX, chunkY)); }
public void rDecorateClay( World worldObj, Random rand, int chunkX, int chunkZ, float river, int worldX, int worldZ) { if (TerrainGen.decorate(worldObj, rand, chunkX, chunkZ, CLAY)) { if (river > 0.85f) { for (int j2 = 0; j2 < 3; j2++) { int l5 = worldX + rand.nextInt(16); int i9 = 53 + rand.nextInt(15); int l11 = worldZ + rand.nextInt(16); (new WorldGenClay(Blocks.clay, 0, clayPerVein)).generate(worldObj, rand, l5, i9, l11); } } } }
{ caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE); strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD); villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE); mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT); scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); // treeGenerator = new WorldGenAtumTrees(true); }
public ChunkProviderBase(World world, long seed, Dimension dim) { dimension = dim; stoneNoise = new double[256]; /// caveGenerator = new MapGenKytherCaves(); /// ravineGenerator = new MapGenKytherTrench(); worldObj = world; rand = new Random(seed); noiseGen1 = new NoiseGeneratorOctaves(rand, 16); noiseGen2 = new NoiseGeneratorOctaves(rand, 16); noiseGen3 = new NoiseGeneratorOctaves(rand, 8); noiseGen4 = new NoiseGeneratorOctaves(rand, 4); noiseGen5 = new NoiseGeneratorOctaves(rand, 10); noiseGen6 = new NoiseGeneratorOctaves(rand, 16); mobSpawnerNoise = new NoiseGeneratorOctaves(rand, 8); if (dimension == Dimension.nether) { genNetherBridge = (MapGenNetherBridge) TerrainGen.getModdedMapGen(genNetherBridge, NETHER_BRIDGE); } }
@Override public void setup(World world, GenericChunkProvider provider) { this.world = world; this.provider = provider; this.noiseGen1 = new NoiseGeneratorOctaves(provider.rand, 16); this.noiseGen2 = new NoiseGeneratorOctaves(provider.rand, 16); this.noiseGen3 = new NoiseGeneratorOctaves(provider.rand, 8); this.noiseGen4 = new NoiseGeneratorPerlin(provider.rand, 4); NoiseGeneratorOctaves noiseGen5 = new NoiseGeneratorOctaves(provider.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(provider.rand, 16); NoiseGeneratorOctaves mobSpawnerNoise = new NoiseGeneratorOctaves(provider.rand, 8); NoiseGenerator[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise }; noiseGens = TerrainGen.getModdedNoiseGenerators(world, provider.rand, noiseGens); this.noiseGen1 = (NoiseGeneratorOctaves) noiseGens[0]; this.noiseGen2 = (NoiseGeneratorOctaves) noiseGens[1]; this.noiseGen3 = (NoiseGeneratorOctaves) noiseGens[2]; this.noiseGen4 = (NoiseGeneratorPerlin) noiseGens[3]; this.noiseGen6 = (NoiseGeneratorOctaves) noiseGens[5]; }
public AtumChunkProvider(World par1World, long par2, boolean par4) { this.worldObj = par1World; this.mapFeaturesEnabled = par4; this.rand = new Random(par2); this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8); this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); NoiseGeneratorOctaves[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise }; noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens); this.noiseGen1 = noiseGens[0]; this.noiseGen2 = noiseGens[1]; this.noiseGen3 = noiseGens[2]; this.noiseGen4 = noiseGens[3]; this.noiseGen5 = noiseGens[4]; this.noiseGen6 = noiseGens[5]; this.mobSpawnerNoise = noiseGens[6]; }
@Override protected void genDecorations(BiomeGenBase p_150513_1_) { MinecraftForge.EVENT_BUS.post( new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); this.generateOres(); int i; int j; int k; boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); for (i = 0; doGen && i < this.sandPerChunk2; ++i) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.sandGen.generate( this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); for (i = 0; doGen && i < this.clayPerChunk; ++i) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.clayGen.generate( this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); for (i = 0; doGen && i < this.sandPerChunk; ++i) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.gravelAsSandGen.generate( this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); } i = this.treesPerChunk; if (this.randomGenerator.nextInt(10) == 0) { ++i; } int l; int i1; for (j = 0; j < i; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) {; } // if(randomGenerator.nextInt() == 0) { WorldGenTrees worldGenTree = new WorldGenTrees(false, 6, 0, 0, true); worldGenTree.setScale(1.0D, 1.0D, 1.0D); worldGenTree.generate(this.currentWorld, this.randomGenerator, k, i1, l); /*} else { treeGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); }*/ } /* * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, * chunk_Z, TREE); for (j = 0; doGen && j < i; ++j) { k = this.chunk_X + * this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + * this.randomGenerator.nextInt(16) + 8; i1 = * this.currentWorld.getHeightValue(k, l); WorldGenAbstractTree * worldgenabstracttree = * p_150513_1_.func_150567_a(this.randomGenerator); * worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D); * * if (worldgenabstracttree.generate(this.currentWorld, * this.randomGenerator, k, i1, l)) { * worldgenabstracttree.func_150524_b(this.currentWorld, * this.randomGenerator, k, i1, l); } } */ /* * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, * chunk_Z, BIG_SHROOM); for (j = 0; doGen && j < * this.bigMushroomsPerChunk; ++j) { k = this.chunk_X + * this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + * this.randomGenerator.nextInt(16) + 8; * this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, * k, this.currentWorld.getHeightValue(k, l), l); } */ /* * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, * chunk_Z, FLOWERS); for (j = 0; doGen && j < this.flowersPerChunk; * ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = * this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = * nextInt(this.currentWorld.getHeightValue(k, l) + 32); String s = * p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l); * BlockFlower blockflower = BlockFlower.func_149857_e(s); * * if (blockflower.getMaterial() != Material.air) { * this.yellowFlowerGen.func_150550_a(blockflower, * BlockFlower.func_149856_f(s)); * this.yellowFlowerGen.generate(this.currentWorld, * this.randomGenerator, k, i1, l); } } */ if (this.randomGenerator.nextInt(4) == 0) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); WorldGenerator worldgenerator = new WorldGenShrub(0, 0); worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) {; } this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); for (j = 0; doGen && j < 2; ++j) { if (this.randomGenerator.nextInt(4) == 0) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = this.currentWorld.getHeightValue(k, l); this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } if (this.randomGenerator.nextInt(8) == 0) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } } if (doGen && this.randomGenerator.nextInt(4) == 0) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); } if (doGen && this.randomGenerator.nextInt(8) == 0) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); for (j = 0; doGen && j < this.reedsPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } for (j = 0; doGen && j < 10; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } /* * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, * chunk_Z, PUMPKIN); if (doGen && this.randomGenerator.nextInt(32) == * 0) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k = * this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l = * nextInt(this.currentWorld.getHeightValue(j, k) * 2); (new * WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, * j, l, k); } */ doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); for (j = 0; doGen && j < this.cactiPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); if (doGen && this.generateLakes) { for (j = 0; j < 50; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; (new WorldGenLiquids(ZombieModpackWorld.finiteWaterSolid)) .generate(this.currentWorld, this.randomGenerator, k, l, i1); } for (j = 0; j < 20; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt( this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; (new WorldGenLiquids(Blocks.flowing_lava)) .generate(this.currentWorld, this.randomGenerator, k, l, i1); } } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); for (j = 0; doGen && j < 10; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); if (this.randomGenerator.nextInt(4) == 0) { new WorldGenGrass().generate(currentWorld, randomGenerator, k, i1, l); } } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); for (j = 0; doGen && j < 10; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator); worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); } MinecraftForge.EVENT_BUS.post( new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); }
@Override public void populate(int chunkX, int chunkZ) { BlockFalling.fallInstantly = true; int worldX = chunkX * 16; int worldZ = chunkZ * 16; BlockPos blockPos = new BlockPos(worldX, 0, worldZ); Biome biome = worldObj.getBiomeGenForCoords(blockPos.add(16, 0, 16)); BiomeDecorator decorator = biome.theBiomeDecorator; int worldHeight = worldObj.provider.getActualHeight(); ForgeEventFactory.onChunkPopulate(true, this, worldObj, rand, chunkX, chunkZ, false); int x, y, z; if (CavelandConfig.generateLakes) { if (TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, false, EventType.LAKE)) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 16); z = rand.nextInt(16) + 8; lakeWaterGen.generate(worldObj, rand, blockPos.add(x, y, z)); } if (rand.nextInt(30) == 0 && TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, false, EventType.LAVA)) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight / 2); z = rand.nextInt(16) + 8; lakeLavaGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, blockPos)); MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(worldObj, rand, blockPos)); for (CaveVein vein : CavelandConfig.veinManager.getCaveVeins()) { vein.generateVeins(worldObj, rand, blockPos); } MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(worldObj, rand, blockPos)); for (int i = 0; i < 10; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 10); z = rand.nextInt(16) + 8; acresiaGen.generate(worldObj, rand, blockPos.add(x, y, z)); } for (int i = 0; i < 15; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight / 2 - 10) + worldHeight / 2; z = rand.nextInt(16) + 8; acresiaGen.generate(worldObj, rand, blockPos.add(x, y, z)); } if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.SHROOM)) { for (int i = 0; i < 5; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 10); z = rand.nextInt(16) + 8; decorator.mushroomBrownGen.generate(worldObj, rand, blockPos.add(x, y, z)); } for (int i = 0; i < 5; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 10); z = rand.nextInt(16) + 8; decorator.mushroomRedGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } if (BiomeDictionary.isBiomeOfType(biome, Type.SANDY)) { if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.CACTUS)) { for (int i = 0; i < 80; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 5); z = rand.nextInt(16) + 8; decorator.cactusGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.DEAD_BUSH)) { for (int i = 0; i < 10; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 5); z = rand.nextInt(16) + 8; deadBushGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } } else { if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.FLOWERS)) { for (int i = 0; i < 8; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 5); z = rand.nextInt(16) + 8; decorator.yellowFlowerGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } for (int i = 0; i < 18; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight - 5); z = rand.nextInt(16) + 8; biome.getRandomWorldGenForGrass(rand).generate(worldObj, rand, blockPos.add(x, y, z)); } if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.TREE)) { WorldGenAbstractTree treeGen = null; if (BiomeDictionary.isBiomeOfType(biome, Type.JUNGLE)) { treeGen = new WorldGenTreesPerverted( false, 4 + rand.nextInt(7), BlockPlanks.EnumType.JUNGLE, true); } else if (BiomeDictionary.isBiomeOfType(biome, Type.FOREST) || !BiomeDictionary.isBiomeOfType(biome, Type.PLAINS) || rand.nextInt(10) == 0) { if (BiomeDictionary.isBiomeOfType(biome, Type.COLD)) { treeGen = new WorldGenSpruceTreePerverted(false); } else if (rand.nextInt(3) == 0) { treeGen = new WorldGenBirchTreePerverted(false, false); } else { treeGen = new WorldGenTreesPerverted(false, 3, BlockPlanks.EnumType.OAK, true); } } if (treeGen != null) { for (int i = 0; i < 80; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight); z = rand.nextInt(16) + 8; BlockPos pos = blockPos.add(x, y, z); if (treeGen.generate(worldObj, rand, pos)) { treeGen.generateSaplings(worldObj, rand, pos); } } for (int i = 0; i < 60; ++i) { x = rand.nextInt(16) + 8; y = 8 + rand.nextInt(5); z = rand.nextInt(16) + 8; BlockPos pos = blockPos.add(x, y, z); if (treeGen.generate(worldObj, rand, pos)) { treeGen.generateSaplings(worldObj, rand, pos); } } } } if (decorator.generateLakes) { if (BiomeDictionary.isBiomeOfType(biome, Type.WATER)) { if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_WATER)) { for (int i = 0; i < 150; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(rand.nextInt(worldHeight - 16) + 10); z = rand.nextInt(16) + 8; liquidWaterGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } } else { if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_WATER)) { for (int i = 0; i < 100; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(rand.nextInt(worldHeight - 16) + 10); z = rand.nextInt(16) + 8; liquidWaterGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_LAVA)) { for (int i = 0; i < 20; ++i) { x = rand.nextInt(16) + 8; y = rand.nextInt(worldHeight / 2); z = rand.nextInt(16) + 8; liquidLavaGen.generate(worldObj, rand, blockPos.add(x, y, z)); } } } } } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, blockPos)); ForgeEventFactory.onChunkPopulate(false, this, worldObj, rand, chunkX, chunkZ, false); BlockFalling.fallInstantly = false; }
@Override public void rDecorate( World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river) { /** * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this * method. */ rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome); // boulders for (int l = 0; l < 3f * strength; ++l) { int i1 = chunkX + rand.nextInt(16) + 8; int j1 = chunkY + rand.nextInt(16) + 8; int k1 = world.getHeightValue(i1, j1); if (k1 < 95 && rand.nextInt(16) == 0) { (new WorldGenBlob(Blocks.mossy_cobblestone, 0, rand)).generate(world, rand, i1, k1, j1); } } float l = simplex.noise2(chunkX / 100f, chunkY / 100f) * 6f + 0.8f; if (TerrainGen.decorate(world, rand, chunkX, chunkY, TREE)) { for (int b1 = 0; b1 < l * 4f * strength; b1++) { int j6 = chunkX + rand.nextInt(16) + 8; int k10 = chunkY + rand.nextInt(16) + 8; int z52 = world.getHeightValue(j6, k10); WorldGenerator worldgenerator = rand.nextInt(4) == 0 ? new WorldGenTreeRTGSpruceSmall(1 + rand.nextInt(2)) : rand.nextInt(6) == 0 ? new WorldGenTreeRTGPineSmall(1 + rand.nextInt(3), 4 + rand.nextInt(4)) : new WorldGenTreeRTGPineSmall(4 + rand.nextInt(6), 5 + rand.nextInt(10)); worldgenerator.setScale(1.0D, 1.0D, 1.0D); worldgenerator.generate(world, rand, j6, z52, k10); } if (this.config.getPropertyById(BiomeConfigVanillaColdTaiga.decorationLogsId).valueBoolean) { if (l > 0f && rand.nextInt(6) == 0) { int x22 = chunkX + rand.nextInt(16) + 8; int z22 = chunkY + rand.nextInt(16) + 8; int y22 = world.getHeightValue(x22, z22); (new WorldGenLog(1, 3 + rand.nextInt(4), false)).generate(world, rand, x22, y22, z22); } } for (int b = 0; b < 2f * strength; b++) { int i1 = chunkX + rand.nextInt(16) + 8; int j1 = chunkY + rand.nextInt(16) + 8; int k1 = world.getHeightValue(i1, j1); if (rand.nextInt(10) == 0) { (new WorldGenTreeRTGShrub(rand.nextInt(5) + 4, rand.nextInt(2), rand.nextInt(2))) .generate(world, rand, i1, k1, j1); } else { (new WorldGenTreeRTGShrub(rand.nextInt(4) + 1, rand.nextInt(2), rand.nextInt(2))) .generate(world, rand, i1, k1, j1); } } } if (TerrainGen.decorate(world, rand, chunkX, chunkY, SHROOM)) { if (rand.nextInt((int) (3f / strength)) == 0) { int k15 = chunkX + rand.nextInt(16) + 8; int k17 = rand.nextInt(64) + 64; int k20 = chunkY + rand.nextInt(16) + 8; if (rand.nextBoolean()) { (new WorldGenFlowers(Blocks.brown_mushroom)).generate(world, rand, k15, k17, k20); } else { (new WorldGenFlowers(Blocks.red_mushroom)).generate(world, rand, k15, k17, k20); } } } if (TerrainGen.decorate(world, rand, chunkX, chunkY, PUMPKIN)) { if (rand.nextInt((int) (20f / strength)) == 0) { int j16 = chunkX + rand.nextInt(16) + 8; int j18 = rand.nextInt(128); int j21 = chunkY + rand.nextInt(16) + 8; (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21); } } if (TerrainGen.decorate(world, rand, chunkX, chunkY, GRASS)) { for (int l14 = 0; l14 < 10f * strength; l14++) { int l19 = chunkX + rand.nextInt(16) + 8; int k22 = rand.nextInt(128); int j24 = chunkY + rand.nextInt(16) + 8; (new WorldGenGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24); } } }
/** Populates chunk with ores etc etc */ @Override public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { long time = System.currentTimeMillis(); BlockSand.fallInstantly = true; int k = par2 * 16; int l = par3 * 16; BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); this.rand.setSeed(this.worldObj.getSeed()); long i1 = this.rand.nextLong() / 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L; this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed()); boolean flag = false; MinecraftForge.EVENT_BUS.post( new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag)); /* if (this.mapFeaturesEnabled) { this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); }*/ int k1; int l1; int i2; if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag && this.rand.nextInt(8) == 0) { k1 = k + this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(this.rand.nextInt(120) + 8); i2 = l + this.rand.nextInt(16) + 8; if (l1 < 63 || this.rand.nextInt(10) == 0) { (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, k1, l1, i2); } } /*boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON); for (k1 = 0; doGen && k1 < 8; ++k1) { l1 = k + this.rand.nextInt(16) + 8; i2 = this.rand.nextInt(128); int j2 = l + this.rand.nextInt(16) + 8; if ((new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2)) { ; } }*/ biomegenbase.decorate(this.worldObj, this.rand, k, l); SpawnerAnimals.performWorldGenSpawning( this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); k += 8; l += 8; MinecraftForge.EVENT_BUS.post( new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); BlockSand.fallInstantly = false; // System.out.println("Populating chunk: " + (System.currentTimeMillis() - time) + "ms"); }
public void rPopulatePreDecorate( IChunkProvider ichunkprovider, World worldObj, Random rand, int chunkX, int chunkZ, boolean flag) { int worldX = chunkX * 16; int worldZ = chunkZ * 16; boolean gen = true; gen = TerrainGen.populate( ichunkprovider, worldObj, rand, chunkX, chunkZ, flag, PopulateChunkEvent.Populate.EventType.LAKE); // Underground water lakes. if (ConfigRTG.enableWaterUndergroundLakes) { if (gen && (waterUndergroundLakeChance > 0)) { int i2 = worldX + rand.nextInt(16) + 8; int l4 = RandomUtil.getRandomInt(rand, 1, 50); int i8 = worldZ + rand.nextInt(16) + 8; if (rand.nextInt(waterUndergroundLakeChance) == 0 && (RandomUtil.getRandomInt(rand, 1, ConfigRTG.waterUndergroundLakeChance) == 1)) { (new WorldGenLakes(Blocks.water)).generate(worldObj, rand, i2, l4, i8); } } } // Surface water lakes. if (ConfigRTG.enableWaterSurfaceLakes) { if (gen && (waterSurfaceLakeChance > 0)) { int i2 = worldX + rand.nextInt(16) + 8; int i8 = worldZ + rand.nextInt(16) + 8; int l4 = worldObj.getHeightValue(i2, i8); // Surface lakes. if (rand.nextInt(waterSurfaceLakeChance) == 0 && (RandomUtil.getRandomInt(rand, 1, ConfigRTG.waterSurfaceLakeChance) == 1)) { if (l4 > 63) { (new WorldGenLakes(Blocks.water)).generate(worldObj, rand, i2, l4, i8); } } } } gen = TerrainGen.populate( ichunkprovider, worldObj, rand, chunkX, chunkZ, flag, PopulateChunkEvent.Populate.EventType.LAVA); // Underground lava lakes. if (ConfigRTG.enableLavaUndergroundLakes) { if (gen && (lavaUndergroundLakeChance > 0)) { int i2 = worldX + rand.nextInt(16) + 8; int l4 = RandomUtil.getRandomInt(rand, 1, 50); int i8 = worldZ + rand.nextInt(16) + 8; if (rand.nextInt(lavaUndergroundLakeChance) == 0 && (RandomUtil.getRandomInt(rand, 1, ConfigRTG.lavaUndergroundLakeChance) == 1)) { (new WorldGenLakes(Blocks.lava)).generate(worldObj, rand, i2, l4, i8); } } } // Surface lava lakes. if (ConfigRTG.enableLavaSurfaceLakes) { if (gen && (lavaSurfaceLakeChance > 0)) { int i2 = worldX + rand.nextInt(16) + 8; int i8 = worldZ + rand.nextInt(16) + 8; int l4 = worldObj.getHeightValue(i2, i8); // Surface lakes. if (rand.nextInt(lavaSurfaceLakeChance) == 0 && (RandomUtil.getRandomInt(rand, 1, ConfigRTG.lavaSurfaceLakeChance) == 1)) { if (l4 > 63) { (new WorldGenLakes(Blocks.lava)).generate(worldObj, rand, i2, l4, i8); } } } } if (ConfigRTG.generateDungeons) { gen = TerrainGen.populate( ichunkprovider, worldObj, rand, chunkX, chunkZ, flag, PopulateChunkEvent.Populate.EventType.DUNGEON); for (int k1 = 0; k1 < 8 && gen; k1++) { int j5 = worldX + rand.nextInt(16) + 8; int k8 = rand.nextInt(128); int j11 = worldZ + rand.nextInt(16) + 8; (new WorldGenDungeons()).generate(worldObj, rand, j5, k8, j11); } } }
@Override public void rDecorate( World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river) { /** * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this * method. */ // rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome); float l = simplex.noise2(chunkX / 80f, chunkY / 80f) * 60f - 15f; // float l = simplex.noise3(chunkX / 80f, chunkY / 80f, simplex.noise2(chunkX / 60f, chunkY / // 60f)) * 60f - 15f; for (int l1 = 0; l1 < 2f * strength; ++l1) { int i1 = chunkX + rand.nextInt(16) + 8; int j1 = chunkY + rand.nextInt(16) + 8; int k1 = world.getHeightValue(i1, j1); if (k1 < 80 && rand.nextInt(20) == 0) { if (rand.nextInt(8) != 0) { (new WorldGenBlob(Blocks.mossy_cobblestone, 0, rand)).generate(world, rand, i1, k1, j1); } else { (new WorldGenBlob(Blocks.web, 0, rand)).generate(world, rand, i1, k1, j1); } } } if (l > 0f) { for (int b2 = 0; b2 < 24f * strength; b2++) { int j6 = chunkX + rand.nextInt(16) + 8; int k10 = chunkY + rand.nextInt(16) + 8; int z52 = world.getHeightValue(j6, k10); if (z52 < 120) { WorldGenerator worldgenerator = new WorldGenTreeMangrove( Blocks.log2, 1, Blocks.leaves2, 1, 9 + rand.nextInt(5), 3 + rand.nextInt(2), 13f, 3, 0.32f, 0.1f); worldgenerator.setScale(1.0D, 1.0D, 1.0D); worldgenerator.generate(world, rand, j6, z52, k10); } } } if (rand.nextInt((int) (10f / strength)) == 0) { int x22 = chunkX + rand.nextInt(16) + 8; int z22 = chunkY + rand.nextInt(16) + 8; int y22 = world.getHeightValue(x22, z22); if (y22 < 100) { (new WorldGenLog(Blocks.log2, 1, Blocks.leaves2, -1, 9 + rand.nextInt(5))) .generate(world, rand, x22, y22, z22); } } for (int f24 = 0; f24 < strength; f24++) { int i1 = chunkX + rand.nextInt(16) + 8; int j1 = chunkY + rand.nextInt(16) + 8; int k1 = world.getHeightValue(i1, j1); if (k1 < 110) { (new WorldGenTreeShrub(rand.nextInt(4) + 1, 0, rand.nextInt(3))) .generate(world, rand, i1, k1, j1); } } if (TerrainGen.decorate(world, rand, chunkX, chunkY, GRASS)) { for (int l14 = 0; l14 < 10f * strength; l14++) { int l19 = chunkX + rand.nextInt(16) + 8; int k22 = rand.nextInt(128); int j24 = chunkY + rand.nextInt(16) + 8; int grassMeta; if (rand.nextInt(16) == 0) { grassMeta = 0; } else { grassMeta = 1; } (new WorldGenGrass(Blocks.tallgrass, grassMeta)).generate(world, rand, l19, k22, j24); } for (int l14 = 0; l14 < 8f * strength; l14++) { int l19 = chunkX + rand.nextInt(16) + 8; int k22 = rand.nextInt(128); int j24 = chunkY + rand.nextInt(16) + 8; if (rand.nextInt(6) == 0) { (new WorldGenGrass(Blocks.double_plant, RandomUtil.getRandomInt(rand, 2, 3))) .generate(world, rand, l19, k22, j24); } } for (int l14 = 0; l14 < 4f * strength; l14++) { int l19 = chunkX + rand.nextInt(16) + 8; int k22 = rand.nextInt(128); int j24 = chunkY + rand.nextInt(16) + 8; int grassMeta; if (rand.nextInt(16) == 0) { grassMeta = 0; } else { grassMeta = RandomUtil.getRandomInt(rand, 1, 2); } (new WorldGenGrass(Blocks.tallgrass, grassMeta)).generate(world, rand, l19, k22, j24); } } rDecorateSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome); int k15 = chunkX + rand.nextInt(16) + 8; int k20 = chunkY + rand.nextInt(16) + 8; int k17 = world.getHeightValue(k15, k20); if (rand.nextBoolean()) { (new WorldGenFlowers(Blocks.brown_mushroom)).generate(world, rand, k15, k17, k20); } else { (new WorldGenFlowers(Blocks.red_mushroom)).generate(world, rand, k15, k17, k20); } }
/** Attempts to grow a sapling into a tree */ public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { if (!TerrainGen.saplingGrowTree(par1World, par5Random, par2, par3, par4)) return; int l = par1World.getBlockMetadata(par2, par3, par4) & 3; Object object = null; int i1 = 0; int j1 = 0; boolean flag = false; if (l == 1) { object = new WorldGenTaiga2(true); } else if (l == 2) { object = new WorldGenForest(true); } else if (l == 3) { for (i1 = 0; i1 >= -1; --i1) { for (j1 = 0; j1 >= -1; --j1) { if (this.isSameSapling(par1World, par2 + i1, par3, par4 + j1, 3) && this.isSameSapling(par1World, par2 + i1 + 1, par3, par4 + j1, 3) && this.isSameSapling(par1World, par2 + i1, par3, par4 + j1 + 1, 3) && this.isSameSapling(par1World, par2 + i1 + 1, par3, par4 + j1 + 1, 3)) { object = new WorldGenHugeTrees(true, 10 + par5Random.nextInt(20), 3, 3); flag = true; break; } } if (object != null) { break; } } if (object == null) { j1 = 0; i1 = 0; object = new WorldGenNileTrees(true, 4 + par5Random.nextInt(7), 3, 3, false); } } else { object = new WorldGenNileTrees(true); if (par5Random.nextInt(10) == 0) { object = new WorldGenBigTree(true); } } if (flag) { par1World.setBlock(par2 + i1, par3, par4 + j1, 0, 0, 4); par1World.setBlock(par2 + i1 + 1, par3, par4 + j1, 0, 0, 4); par1World.setBlock(par2 + i1, par3, par4 + j1 + 1, 0, 0, 4); par1World.setBlock(par2 + i1 + 1, par3, par4 + j1 + 1, 0, 0, 4); } else { par1World.setBlock(par2, par3, par4, 0, 0, 4); } if (!((WorldGenerator) object).generate(par1World, par5Random, par2 + i1, par3, par4 + j1)) { if (flag) { par1World.setBlock(par2 + i1, par3, par4 + j1, this.blockID, l, 4); par1World.setBlock(par2 + i1 + 1, par3, par4 + j1, this.blockID, l, 4); par1World.setBlock(par2 + i1, par3, par4 + j1 + 1, this.blockID, l, 4); par1World.setBlock(par2 + i1 + 1, par3, par4 + j1 + 1, this.blockID, l, 4); } else { par1World.setBlock(par2, par3, par4, this.blockID, l, 4); } } }