diff options
author | feildmaster <admin@feildmaster.com> | 2013-01-20 00:34:55 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-23 20:41:05 -0600 |
commit | f1efe717bddde600ec40dc66f6964748eab3e372 (patch) | |
tree | 78e02216cbca7474915915e82753dc359409c8d6 /src/main/java/net/minecraft/server/ItemSkull.java | |
parent | 9df87d339971b55cd8bf0bbfea2fdc031bd0bd4c (diff) | |
download | craftbukkit-f1efe717bddde600ec40dc66f6964748eab3e372.tar craftbukkit-f1efe717bddde600ec40dc66f6964748eab3e372.tar.gz craftbukkit-f1efe717bddde600ec40dc66f6964748eab3e372.tar.lz craftbukkit-f1efe717bddde600ec40dc66f6964748eab3e372.tar.xz craftbukkit-f1efe717bddde600ec40dc66f6964748eab3e372.zip |
Call BlockPlaceEvent for skulls the same as other blocks. BUKKIT-3406
When the skull BlockPlaceEvent was added it was made so the event
would be called after all the data has been set, however this is a
behavior change that is inconsistent with other BlockPlaceEvents.
Instead, if people wish to get the block data they should schedule
a task.
Relates to: BUKKIT-3438
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemSkull.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemSkull.java | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java index facd5d44..bf2cd4f3 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; } |