Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 73 lines 2.1 kB view raw
1package net.minecraft.server; 2 3import java.util.Random; 4 5public class BlockReed extends Block { 6 7 protected BlockReed(int i, int j) { 8 super(i, Material.PLANT); 9 this.textureId = j; 10 float f = 0.375F; 11 12 this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); 13 this.a(true); 14 } 15 16 public void a(World world, int i, int j, int k, Random random) { 17 if (world.isEmpty(i, j + 1, k)) { 18 int l; 19 20 for (l = 1; world.getTypeId(i, j - l, k) == this.id; ++l) { 21 ; 22 } 23 24 if (l < 3) { 25 int i1 = world.getData(i, j, k); 26 27 if (i1 == 15) { 28 world.setTypeId(i, j + 1, k, this.id); 29 world.setData(i, j, k, 0); 30 } else { 31 world.setData(i, j, k, i1 + 1); 32 } 33 } 34 } 35 } 36 37 public boolean canPlace(World world, int i, int j, int k) { 38 int l = world.getTypeId(i, j - 1, k); 39 40 return l == this.id ? true : (l != Block.GRASS.id && l != Block.DIRT.id ? false : (world.getMaterial(i - 1, j - 1, k) == Material.WATER ? true : (world.getMaterial(i + 1, j - 1, k) == Material.WATER ? true : (world.getMaterial(i, j - 1, k - 1) == Material.WATER ? true : world.getMaterial(i, j - 1, k + 1) == Material.WATER)))); 41 } 42 43 public void doPhysics(World world, int i, int j, int k, int l) { 44 this.g(world, i, j, k); 45 } 46 47 protected final void g(World world, int i, int j, int k) { 48 if (!this.f(world, i, j, k)) { 49 this.g(world, i, j, k, world.getData(i, j, k)); 50 world.setTypeId(i, j, k, 0); 51 } 52 } 53 54 public boolean f(World world, int i, int j, int k) { 55 return this.canPlace(world, i, j, k); 56 } 57 58 public AxisAlignedBB e(World world, int i, int j, int k) { 59 return null; 60 } 61 62 public int a(int i, Random random) { 63 return Item.SUGAR_CANE.id; 64 } 65 66 public boolean a() { 67 return false; 68 } 69 70 public boolean b() { 71 return false; 72 } 73}