diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 05:23:17 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 05:23:17 +0100 |
commit | 706f0da595b38a7fea0b043c1adff3147e066f5b (patch) | |
tree | af30c8161fcb669bb936cff3f12f8d8c525cb6db /src/main | |
parent | 1c95476a00958ff19dfb18ab1a621546b3ad5be4 (diff) | |
download | craftbukkit-706f0da595b38a7fea0b043c1adff3147e066f5b.tar craftbukkit-706f0da595b38a7fea0b043c1adff3147e066f5b.tar.gz craftbukkit-706f0da595b38a7fea0b043c1adff3147e066f5b.tar.lz craftbukkit-706f0da595b38a7fea0b043c1adff3147e066f5b.tar.xz craftbukkit-706f0da595b38a7fea0b043c1adff3147e066f5b.zip |
Fix for ItemDoor crash
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemDoor.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java index 7e772b80..5e366baf 100644 --- a/src/main/java/net/minecraft/server/ItemDoor.java +++ b/src/main/java/net/minecraft/server/ItemDoor.java @@ -50,7 +50,11 @@ public class ItemDoor extends Item { } } - // Craftbukkit - void -> boolean + entityhuman argument + public static void a(World world, int i, int j, int k, int l, Block block) { + // CraftBukkit Start + a(world, i, j, k, l, block, null); + } + public static boolean a(World world, int i, int j, int k, int l, Block block, EntityHuman entityhuman) { int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit byte b0 = 0; @@ -93,23 +97,27 @@ public class ItemDoor extends Item { world.suppressPhysics = true; world.setTypeIdAndData(i, j, k, block.id, l); - // CraftBukkit start - bed world.suppressPhysics = false; + world.applyPhysics(i, j, k, Block.REDSTONE_WIRE.id); - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, block); - if (event.isCancelled() || !event.canBuild()) { - event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); - return false; + if (entityhuman != null) { + BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, block); + + if (event.isCancelled() || !event.canBuild()) { + event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); + return false; + } } world.suppressPhysics = true; - // CraftBukkit end world.setTypeIdAndData(i, j + 1, k, block.id, l + 8); world.suppressPhysics = false; + // world.applyPhysics(i, j, k, block.id); // CraftBukkit - moved up world.applyPhysics(i, j + 1, k, block.id); - return true; // CraftBukkit + return true; + // CraftBukkit end } } |