summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemDoor.java
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2013-01-27 10:44:32 -0600
committerfeildmaster <admin@feildmaster.com>2013-01-27 10:44:32 -0600
commit899b9c17cc469851cbc42c5a326869e97b492de4 (patch)
tree1192ebe54aa2e95be9823254bb7cda06bdf634d9 /src/main/java/net/minecraft/server/ItemDoor.java
parent528bbbdcd896e67067bcf53b95cadb9dc0081ebf (diff)
downloadcraftbukkit-899b9c17cc469851cbc42c5a326869e97b492de4.tar
craftbukkit-899b9c17cc469851cbc42c5a326869e97b492de4.tar.gz
craftbukkit-899b9c17cc469851cbc42c5a326869e97b492de4.tar.lz
craftbukkit-899b9c17cc469851cbc42c5a326869e97b492de4.tar.xz
craftbukkit-899b9c17cc469851cbc42c5a326869e97b492de4.zip
Direct all BlockPlaceEvents to a singular location. Fixes BUKKIT-3438
By having a single function to process BlockPlacement logic, we make it so that there is consistent behavior throughout all BlockPlace events. This should allow for easier troubleshooting and less diffs in source. This also fixes BUKKIT-3463 by including the correct coordinates that were clicked to the event.
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemDoor.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemDoor.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java
index 4cbe26b5..ea19a3ab 100644
--- a/src/main/java/net/minecraft/server/ItemDoor.java
+++ b/src/main/java/net/minecraft/server/ItemDoor.java
@@ -12,6 +12,7 @@ public class ItemDoor extends Item {
}
public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
+ final int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
if (l != 1) {
return false;
} else {
@@ -31,7 +32,7 @@ public class ItemDoor extends Item {
int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
// CraftBukkit start
- if (!place(world, i, j, k, i1, block, entityhuman)) {
+ if (!place(world, i, j, k, i1, block, entityhuman, clickedX, clickedY, clickedZ)) {
return false;
}
// CraftBukkit end
@@ -47,10 +48,10 @@ public class ItemDoor extends Item {
public static void place(World world, int i, int j, int k, int l, Block block) {
// CraftBukkit start
- place(world, i, j, k, l, block, null);
+ place(world, i, j, k, l, block, null, i, j, k);
}
- public static boolean place(World world, int i, int j, int k, int l, Block block, EntityHuman entityhuman) {
+ public static boolean place(World world, int i, int j, int k, int l, Block block, EntityHuman entityhuman, int clickedX, int clickedY, int clickedZ) {
// CraftBukkit end
byte b0 = 0;
byte b1 = 0;
@@ -86,7 +87,7 @@ public class ItemDoor extends Item {
world.suppressPhysics = true;
// CraftBukkit start
if (entityhuman != null) {
- if(!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, block.id, l)) {
+ if(!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, block.id, l, clickedX, clickedY, clickedZ)) {
((EntityPlayer) entityhuman).playerConnection.sendPacket(new Packet53BlockChange(i, j + 1, k, world));
return false;
}