diff options
author | Feildmaster <admin@feildmaster.com> | 2012-02-11 20:03:54 -0600 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-22 21:46:44 -0500 |
commit | 847e1c62c5b6d5f40d0be8a465140e8255e82ec9 (patch) | |
tree | 08464ac4a3c9034059b2ca91f536ff0fe6bafdb8 /src/main/java/net/minecraft/server/BlockReed.java | |
parent | 326091c130657294157d137895663ad2924c0b95 (diff) | |
download | craftbukkit-847e1c62c5b6d5f40d0be8a465140e8255e82ec9.tar craftbukkit-847e1c62c5b6d5f40d0be8a465140e8255e82ec9.tar.gz craftbukkit-847e1c62c5b6d5f40d0be8a465140e8255e82ec9.tar.lz craftbukkit-847e1c62c5b6d5f40d0be8a465140e8255e82ec9.tar.xz craftbukkit-847e1c62c5b6d5f40d0be8a465140e8255e82ec9.zip |
[Bleeding] Added BlockCrops, BlockReed, BlockStem, BlockNetherWart for diff visibility.
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockReed.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockReed.java | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java new file mode 100644 index 00000000..21afe6a3 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockReed.java @@ -0,0 +1,77 @@ +package net.minecraft.server; + +import java.util.Random; + +public class BlockReed extends Block { + + protected BlockReed(int i, int j) { + super(i, Material.PLANT); + this.textureId = j; + float f = 0.375F; + + this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + this.a(true); + } + + public void a(World world, int i, int j, int k, Random random) { + if (world.isEmpty(i, j + 1, k)) { + int l; + + for (l = 1; world.getTypeId(i, j - l, k) == this.id; ++l) { + ; + } + + if (l < 3) { + int i1 = world.getData(i, j, k); + + if (i1 == 15) { + world.setTypeId(i, j + 1, k, this.id); + world.setData(i, j, k, 0); + } else { + world.setData(i, j, k, i1 + 1); + } + } + } + } + + public boolean canPlace(World world, int i, int j, int k) { + int l = world.getTypeId(i, j - 1, k); + + return l == this.id ? true : (l != Block.GRASS.id && l != Block.DIRT.id && l != Block.SAND.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)))); + } + + public void doPhysics(World world, int i, int j, int k, int l) { + this.g(world, i, j, k); + } + + protected final void g(World world, int i, int j, int k) { + if (!this.f(world, i, j, k)) { + this.b(world, i, j, k, world.getData(i, j, k), 0); + world.setTypeId(i, j, k, 0); + } + } + + public boolean f(World world, int i, int j, int k) { + return this.canPlace(world, i, j, k); + } + + public AxisAlignedBB e(World world, int i, int j, int k) { + return null; + } + + public int getDropType(int i, Random random, int j) { + return Item.SUGAR_CANE.id; + } + + public boolean a() { + return false; + } + + public boolean b() { + return false; + } + + public int c() { + return 1; + } +} |