From 899b9c17cc469851cbc42c5a326869e97b492de4 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Sun, 27 Jan 2013 10:44:32 -0600 Subject: 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. --- src/main/java/net/minecraft/server/ItemDoor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/net/minecraft/server/ItemDoor.java') 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; } -- cgit v1.2.3