From 9220831ea49304b8e6a51145926badd3e9d6aacc Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Tue, 1 Oct 2013 23:43:24 +0200 Subject: [PATCH] Fixed door rotation and disabled door y flipping. Mojang radically changd the way doors work, so y flipping on a per-block basis is now impossible. --- .../com/sk89q/worldedit/blocks/BlockData.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockData.java b/src/main/java/com/sk89q/worldedit/blocks/BlockData.java index 8f0e3c8ac..226678dfc 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockData.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockData.java @@ -106,6 +106,13 @@ public final class BlockData { case BlockID.WOODEN_DOOR: case BlockID.IRON_DOOR: + if ((data & 0x8) != 0) { + // door top halves contain no orientation information + break; + } + + /* FALL-THROUGH */ + case BlockID.COCOA_PLANT: case BlockID.TRIPWIRE_HOOK: int extra = data & ~0x3; @@ -305,6 +312,13 @@ public final class BlockData { case BlockID.WOODEN_DOOR: case BlockID.IRON_DOOR: + if ((data & 0x8) != 0) { + // door top halves contain no orientation information + break; + } + + /* FALL-THROUGH */ + case BlockID.COCOA_PLANT: case BlockID.TRIPWIRE_HOOK: int extra = data & ~0x3; @@ -532,7 +546,11 @@ public final class BlockData { case BlockID.WOODEN_DOOR: case BlockID.IRON_DOOR: - data ^= flipY << 3; + if ((data & 0x8) != 0) { + // door top halves contain no orientation information + break; + } + switch (data & 0x3) { case 0: return data + flipX + flipZ * 3; case 1: return data - flipX + flipZ;