diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java index facd5d4472..bf2cd4f300 100644 --- a/src/main/java/net/minecraft/server/ItemSkull.java +++ b/src/main/java/net/minecraft/server/ItemSkull.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit - public class ItemSkull extends Item { private static final String[] a = new String[] { "skeleton", "wither", "zombie", "char", "creeper"}; @@ -20,8 +18,6 @@ public class ItemSkull extends Item { } else if (!world.getMaterial(i, j, k).isBuildable()) { return false; } else { - int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit - if (l == 1) { ++j; } @@ -47,9 +43,13 @@ public class ItemSkull extends Item { } else if (!Block.SKULL.canPlace(world, i, j, k)) { return false; } else { - CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit - - world.setTypeIdAndData(i, j, k, Block.SKULL.id, l); + // CraftBukkit start - handle in ItemBlock + // world.setTypeIdAndData(i, j, k, Block.SKULL.id, l); + if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, Block.SKULL.id, l)) { + return false; + } + l = world.getData(i, j, k); + // CraftBukkit end int i1 = 0; if (l == 1) { @@ -70,15 +70,6 @@ public class ItemSkull extends Item { ((BlockSkull) Block.SKULL).a(world, i, j, k, (TileEntitySkull) tileentity); } - // CraftBukkit start - org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); - - if (event.isCancelled() || !event.canBuild()) { - event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); - return false; - } - // CraftBukkit end - --itemstack.count; return true; }