diff options
author | Tahg <tahgtahv@gmail.com> | 2012-01-07 18:38:05 -0500 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2012-01-07 18:38:05 -0500 |
commit | b74a69041e0a86e3be167babded9399907ed9cce (patch) | |
tree | 0c40feb90f3d155c9ea175fcaa66dd519d56f530 /src/main/java/net/minecraft/server/ItemDoor.java | |
parent | 483a619e8add1abe758998deb90af2b00eede649 (diff) | |
download | craftbukkit-b74a69041e0a86e3be167babded9399907ed9cce.tar craftbukkit-b74a69041e0a86e3be167babded9399907ed9cce.tar.gz craftbukkit-b74a69041e0a86e3be167babded9399907ed9cce.tar.lz craftbukkit-b74a69041e0a86e3be167babded9399907ed9cce.tar.xz craftbukkit-b74a69041e0a86e3be167babded9399907ed9cce.zip |
Fix door physics and revert to pre 1.0 behavior
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemDoor.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemDoor.java | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java index fc3dd9c9..7c1aba2d 100644 --- a/src/main/java/net/minecraft/server/ItemDoor.java +++ b/src/main/java/net/minecraft/server/ItemDoor.java @@ -50,12 +50,12 @@ public class ItemDoor extends Item { } public static void a(World world, int i, int j, int k, int l, Block block) { - // CraftBukkit Start + // 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 + // CraftBukkit end byte b0 = 0; byte b1 = 0; @@ -93,30 +93,22 @@ public class ItemDoor extends Item { } CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit - world.suppressPhysics = true; world.setTypeIdAndData(i, j, k, block.id, l); - world.suppressPhysics = false; - - world.applyPhysics(i, j, k, block.id); - + // CraftBukkit start if (entityhuman != null) { - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, block); + BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k, 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, k, block.id); world.applyPhysics(i, j + 1, k, block.id); - - return true; - // CraftBukkit end + return true; // CraftBukkit } } |