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