diff options
author | feildmaster <admin@feildmaster.com> | 2013-01-27 10:44:32 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-27 10:44:32 -0600 |
commit | 899b9c17cc469851cbc42c5a326869e97b492de4 (patch) | |
tree | 1192ebe54aa2e95be9823254bb7cda06bdf634d9 /src/main/java/net/minecraft/server/ItemBed.java | |
parent | 528bbbdcd896e67067bcf53b95cadb9dc0081ebf (diff) | |
download | craftbukkit-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/ItemBed.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBed.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBed.java b/src/main/java/net/minecraft/server/ItemBed.java index ca7dc3f8..15207f62 100644 --- a/src/main/java/net/minecraft/server/ItemBed.java +++ b/src/main/java/net/minecraft/server/ItemBed.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit - public class ItemBed extends Item { public ItemBed(int i) { @@ -10,6 +8,7 @@ public class ItemBed 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 (world.isStatic) { return true; } else if (l != 1) { @@ -40,8 +39,8 @@ public class ItemBed extends Item { if (entityhuman.a(i, j, k, l, itemstack) && entityhuman.a(i + b0, j, k + b1, l, itemstack)) { if (world.isEmpty(i, j, k) && world.isEmpty(i + b0, j, k + b1) && world.v(i, j - 1, k) && world.v(i + b0, j - 1, k + b1)) { // CraftBukkit start - //world.setTypeIdAndData(i, j, k, blockbed.id, i1); - if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, blockbed.id, i1)) { + // world.setTypeIdAndData(i, j, k, blockbed.id, i1); + if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, blockbed.id, i1, clickedX, clickedY, clickedZ)) { return false; } // CraftBukkit end |