diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/BlockVine.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockVine.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockVine.java | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/main/java/net/minecraft/server/BlockVine.java b/src/main/java/net/minecraft/server/BlockVine.java index 03064def..6dc99f66 100644 --- a/src/main/java/net/minecraft/server/BlockVine.java +++ b/src/main/java/net/minecraft/server/BlockVine.java @@ -7,12 +7,12 @@ import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class BlockVine extends Block { public BlockVine(int i) { - super(i, 143, Material.REPLACEABLE_PLANT); + super(i, Material.REPLACEABLE_PLANT); this.b(true); this.a(CreativeModeTab.c); } - public void f() { + public void g() { this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } @@ -78,7 +78,7 @@ public class BlockVine extends Block { flag = true; } - if (!flag && this.e(iblockaccess.getTypeId(i, j + 1, k))) { + if (!flag && this.d(iblockaccess.getTypeId(i, j + 1, k))) { f1 = Math.min(f1, 0.9375F); f4 = 1.0F; f = 0.0F; @@ -90,33 +90,33 @@ public class BlockVine extends Block { this.a(f, f1, f2, f3, f4, f5); } - public AxisAlignedBB e(World world, int i, int j, int k) { + public AxisAlignedBB b(World world, int i, int j, int k) { return null; } public boolean canPlace(World world, int i, int j, int k, int l) { switch (l) { case 1: - return this.e(world.getTypeId(i, j + 1, k)); + return this.d(world.getTypeId(i, j + 1, k)); case 2: - return this.e(world.getTypeId(i, j, k + 1)); + return this.d(world.getTypeId(i, j, k + 1)); case 3: - return this.e(world.getTypeId(i, j, k - 1)); + return this.d(world.getTypeId(i, j, k - 1)); case 4: - return this.e(world.getTypeId(i + 1, j, k)); + return this.d(world.getTypeId(i + 1, j, k)); case 5: - return this.e(world.getTypeId(i - 1, j, k)); + return this.d(world.getTypeId(i - 1, j, k)); default: return false; } } - private boolean e(int i) { + private boolean d(int i) { if (i == 0) { return false; } else { @@ -126,7 +126,7 @@ public class BlockVine extends Block { } } - private boolean l(World world, int i, int j, int k) { + private boolean k(World world, int i, int j, int k) { int l = world.getData(i, j, k); int i1 = l; @@ -134,17 +134,17 @@ public class BlockVine extends Block { for (int j1 = 0; j1 <= 3; ++j1) { int k1 = 1 << j1; - if ((l & k1) != 0 && !this.e(world.getTypeId(i + Direction.a[j1], j, k + Direction.b[j1])) && (world.getTypeId(i, j + 1, k) != this.id || (world.getData(i, j + 1, k) & k1) == 0)) { + if ((l & k1) != 0 && !this.d(world.getTypeId(i + Direction.a[j1], j, k + Direction.b[j1])) && (world.getTypeId(i, j + 1, k) != this.id || (world.getData(i, j + 1, k) & k1) == 0)) { i1 &= ~k1; } } } - if (i1 == 0 && !this.e(world.getTypeId(i, j + 1, k))) { + if (i1 == 0 && !this.d(world.getTypeId(i, j + 1, k))) { return false; } else { if (i1 != l) { - world.setData(i, j, k, i1); + world.setData(i, j, k, i1, 2); } return true; @@ -152,13 +152,13 @@ public class BlockVine extends Block { } public void doPhysics(World world, int i, int j, int k, int l) { - if (!world.isStatic && !this.l(world, i, j, k)) { + if (!world.isStatic && !this.k(world, i, j, k)) { this.c(world, i, j, k, world.getData(i, j, k), 0); - world.setTypeId(i, j, k, 0); + world.setAir(i, j, k); } } - public void b(World world, int i, int j, int k, Random random) { + public void a(World world, int i, int j, int k, Random random) { if (!world.isStatic && world.random.nextInt(4) == 0) { byte b0 = 4; int l = 5; @@ -197,7 +197,7 @@ public class BlockVine extends Block { l1 = world.random.nextInt(16) & i1; if (l1 > 0) { for (i2 = 0; i2 <= 3; ++i2) { - if (!this.e(world.getTypeId(i + Direction.a[i2], j + 1, k + Direction.b[i2]))) { + if (!this.d(world.getTypeId(i + Direction.a[i2], j + 1, k + Direction.b[i2]))) { l1 &= ~(1 << i2); } } @@ -206,7 +206,7 @@ public class BlockVine extends Block { // CraftBukkit start - fire BlockSpreadEvent org.bukkit.block.Block source = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j + 1, k); - CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, i2); + CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, l1); // CraftBukkit end } } @@ -221,25 +221,26 @@ public class BlockVine extends Block { l1 = world.getTypeId(i + Direction.a[k1], j, k + Direction.b[k1]); if (l1 != 0 && Block.byId[l1] != null) { if (Block.byId[l1].material.k() && Block.byId[l1].b()) { - world.setData(i, j, k, i1 | 1 << k1); + world.setData(i, j, k, i1 | 1 << k1, 2); } } else { i2 = k1 + 1 & 3; j2 = k1 + 3 & 3; + // CraftBukkit start - fire BlockSpreadEvent org.bukkit.block.Block source = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.Block block = world.getWorld().getBlockAt(i + Direction.a[k1], j, k + Direction.b[k1]); - if ((i1 & 1 << i2) != 0 && this.e(world.getTypeId(i + Direction.a[k1] + Direction.a[i2], j, k + Direction.b[k1] + Direction.b[i2]))) { + if ((i1 & 1 << i2) != 0 && this.d(world.getTypeId(i + Direction.a[k1] + Direction.a[i2], j, k + Direction.b[k1] + Direction.b[i2]))) { CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, 1 << i2); - } else if ((i1 & 1 << j2) != 0 && this.e(world.getTypeId(i + Direction.a[k1] + Direction.a[j2], j, k + Direction.b[k1] + Direction.b[j2]))) { + } else if ((i1 & 1 << j2) != 0 && this.d(world.getTypeId(i + Direction.a[k1] + Direction.a[j2], j, k + Direction.b[k1] + Direction.b[j2]))) { CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, 1 << j2); - } else if ((i1 & 1 << i2) != 0 && world.isEmpty(i + Direction.a[k1] + Direction.a[i2], j, k + Direction.b[k1] + Direction.b[i2]) && this.e(world.getTypeId(i + Direction.a[i2], j, k + Direction.b[i2]))) { + } else if ((i1 & 1 << i2) != 0 && world.isEmpty(i + Direction.a[k1] + Direction.a[i2], j, k + Direction.b[k1] + Direction.b[i2]) && this.d(world.getTypeId(i + Direction.a[i2], j, k + Direction.b[i2]))) { block = world.getWorld().getBlockAt(i + Direction.a[k1] + Direction.a[i2], j, k + Direction.b[k1] + Direction.b[i2]); CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, 1 << (k1 + 2 & 3)); - } else if ((i1 & 1 << j2) != 0 && world.isEmpty(i + Direction.a[k1] + Direction.a[j2], j, k + Direction.b[k1] + Direction.b[j2]) && this.e(world.getTypeId(i + Direction.a[j2], j, k + Direction.b[j2]))) { + } else if ((i1 & 1 << j2) != 0 && world.isEmpty(i + Direction.a[k1] + Direction.a[j2], j, k + Direction.b[k1] + Direction.b[j2]) && this.d(world.getTypeId(i + Direction.a[j2], j, k + Direction.b[j2]))) { block = world.getWorld().getBlockAt(i + Direction.a[k1] + Direction.a[j2], j, k + Direction.b[k1] + Direction.b[j2]); CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, 1 << (k1 + 2 & 3)); - } else if (this.e(world.getTypeId(i + Direction.a[k1], j + 1, k + Direction.b[k1]))) { + } else if (this.d(world.getTypeId(i + Direction.a[k1], j + 1, k + Direction.b[k1]))) { CraftEventFactory.handleBlockSpreadEvent(block, source, this.id, 0); } // CraftBukkit end @@ -259,7 +260,7 @@ public class BlockVine extends Block { i2 = world.random.nextInt(16) & i1; j2 = world.getData(i, j - 1, k); if (j2 != (j2 | i2)) { - world.setData(i, j - 1, k, j2 | i2); + world.setData(i, j - 1, k, j2 | i2, 2); } } } @@ -299,7 +300,7 @@ public class BlockVine extends Block { } public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - if (!world.isStatic && entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) { + if (!world.isStatic && entityhuman.cb() != null && entityhuman.cb().id == Item.SHEARS.id) { entityhuman.a(StatisticList.C[this.id], 1); this.b(world, i, j, k, new ItemStack(Block.VINE, 1, 0)); } else { |