summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemRedstone.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemRedstone.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemRedstone.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemRedstone.java b/src/main/java/net/minecraft/server/ItemRedstone.java
index 2119012d..e28a1525 100644
--- a/src/main/java/net/minecraft/server/ItemRedstone.java
+++ b/src/main/java/net/minecraft/server/ItemRedstone.java
@@ -19,6 +19,11 @@ public class ItemRedstone extends Item {
}
public boolean a(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) {
+ // CraftBukkit - store the clicked block
+ CraftWorld craftWorld = ((WorldServer) world).getWorld();
+ CraftServer craftServer = ((WorldServer) world).getServer();
+ org.bukkit.block.Block blockClicked = craftWorld.getBlockAt(i, j, k);
+
if (l == 0) {
j--;
}
@@ -42,13 +47,9 @@ public class ItemRedstone extends Item {
}
if (Block.av.a(world, i, j, k)) {
// CraftBukkit start - Redstone
- CraftWorld craftWorld = ((WorldServer) world).getWorld();
- CraftServer craftServer = ((WorldServer) world).getServer();
-
Type eventType = Type.PLAYER_ITEM;
Player who = (entityplayer == null)?null:(Player)entityplayer.getBukkitEntity();
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
- org.bukkit.block.Block blockClicked = craftWorld.getBlockAt(i, j, k);
BlockFace blockface = CraftBlock.notchToBlockFace(1);
PlayerItemEvent pie = new PlayerItemEvent(eventType, who, itemInHand, blockClicked, blockface);