Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 29 lines 854 B view raw
1package net.minecraft.server; 2 3import java.util.Random; 4 5public class WorldGenCactus extends WorldGenerator { 6 7 public WorldGenCactus() { 8 } 9 10 public boolean a(World world, Random random, int i, int j, int k) { 11 for (int l = 0; l < 10; ++l) { 12 int i1 = i + random.nextInt(8) - random.nextInt(8); 13 int j1 = j + random.nextInt(4) - random.nextInt(4); 14 int k1 = k + random.nextInt(8) - random.nextInt(8); 15 16 if (world.isEmpty(i1, j1, k1)) { 17 int l1 = 1 + random.nextInt(random.nextInt(3) + 1); 18 19 for (int i2 = 0; i2 < l1; ++i2) { 20 if (Block.CACTUS.f(world, i1, j1 + i2, k1)) { 21 world.setRawTypeId(i1, j1 + i2, k1, Block.CACTUS.id); 22 } 23 } 24 } 25 } 26 27 return true; 28 } 29}