Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.chef.mod.generate;
- import java.util.Random;
- import com.chef.mod.Chef;
- import com.chef.mod.Debugger;
- import net.minecraft.block.Block;
- import net.minecraft.init.Blocks;
- import net.minecraft.world.World;
- import net.minecraft.world.gen.feature.WorldGenerator;
- public class WorldGenBush extends WorldGenerator {
- private Block blockA;
- /** The number of blocks to generate. */
- private int numberOfBlocks;
- private Block blockB;
- private static final String __OBFID = "CL_00000426";
- private int mineableBlockMeta;
- public WorldGenBush(int i, Block block)
- {
- this(block, i, Blocks.grass);
- }
- public WorldGenBush(Block block, int i, Block generateAt)
- {
- this.blockA = block;
- this.numberOfBlocks = i;
- this.blockB = generateAt;
- }
- public WorldGenBush(Block block, int meta, int number, Block target)
- {
- this(block, number, target);
- this.mineableBlockMeta = meta;
- }
- public boolean generate(World world, Random random, int x, int y, int z) {
- for (int l = 0; l < 64; ++l) {
- int x1 = x + random.nextInt(8) - random.nextInt(8);
- int y1 = y + random.nextInt(4) - random.nextInt(4);
- int z1 = z + random.nextInt(8) - random.nextInt(8);
- if (world.getHeightValue(x, z) > 60) {
- if (world.isAirBlock(x1, y1, z1) && world.getBlock(x1, y1 - 1, z1) == Blocks.grass && Chef.bushStrawberryBush.canPlaceBlockAt(world, x1, y1, z1)) {
- world.setBlock(x1, y1, z1, Chef.bushStrawberryBush, random.nextInt(1), 1);
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment