diff options
author | feildmaster <admin@feildmaster.com> | 2013-01-16 05:39:13 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-16 08:05:59 -0600 |
commit | 614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78 (patch) | |
tree | 46bc842d8839ee68726d8596e7c3b5c838900ac7 /src/main/java/net/minecraft/server/ItemStep.java | |
parent | 647b82032b7924497dcc10bcb53fb3076b57e144 (diff) | |
download | craftbukkit-614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78.tar craftbukkit-614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78.tar.gz craftbukkit-614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78.tar.lz craftbukkit-614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78.tar.xz craftbukkit-614ef2f8c5d8d1aa3deb0c08283b056cdeeb5d78.zip |
Throw BlockPlaceEvent when placing double slabs. Fixes BUKKIT-2469
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemStep.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemStep.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/ItemStep.java b/src/main/java/net/minecraft/server/ItemStep.java index 8501394c..7ef9a813 100644 --- a/src/main/java/net/minecraft/server/ItemStep.java +++ b/src/main/java/net/minecraft/server/ItemStep.java @@ -37,7 +37,18 @@ public class ItemStep extends ItemBlock { boolean flag = (j1 & 8) != 0; if ((l == 1 && !flag || l == 0 && flag) && i1 == this.b.id && k1 == itemstack.getData()) { - return super.interactWith(itemstack, entityhuman, world, i, j, k, -1, f, f1, f2); // CraftBukkit - handle this in super + // CraftBukkit start - handle in processBlockPlace() + /* + if (world.b(this.c.e(world, i, j, k)) && world.setTypeIdAndData(i, j, k, this.c.id, k1)) { + world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.c.stepSound.getPlaceSound(), (this.c.stepSound.getVolume1() + 1.0F) / 2.0F, this.c.stepSound.getVolume2() * 0.8F); + --itemstack.count; + } + */ + if (world.b(this.c.e(world, i, j, k))) { + processBlockPlace(world, entityhuman, itemstack, i, j, k, this.c.id, k1); + } + // CraftBukkit end + return true; } else { return this.a(itemstack, entityhuman, world, i, j, k, l) ? true : super.interactWith(itemstack, entityhuman, world, i, j, k, l, f, f1, f2); } @@ -74,11 +85,17 @@ public class ItemStep extends ItemBlock { int k1 = j1 & 7; if (i1 == this.b.id && k1 == itemstack.getData()) { + // CraftBukkit start - handle in processBlockPlace() + /* if (world.b(this.c.e(world, i, j, k)) && world.setTypeIdAndData(i, j, k, this.c.id, k1)) { world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.c.stepSound.getPlaceSound(), (this.c.stepSound.getVolume1() + 1.0F) / 2.0F, this.c.stepSound.getVolume2() * 0.8F); --itemstack.count; } - + */ + if (world.b(this.c.e(world, i, j, k))) { + processBlockPlace(world, entityhuman, itemstack, i, j, k, this.c.id, k1); + } + // CraftBukkit end return true; } else { return false; |