From 438a33cc0d22de1792471b42e98786514d7a5aaf Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 31 May 2011 19:43:48 -0700 Subject: [PATCH] Made trapdoors rotatable. --- .../com/sk89q/worldedit/data/BlockData.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/data/BlockData.java b/src/main/java/com/sk89q/worldedit/data/BlockData.java index 5f3684169..66532dc4e 100644 --- a/src/main/java/com/sk89q/worldedit/data/BlockData.java +++ b/src/main/java/com/sk89q/worldedit/data/BlockData.java @@ -115,6 +115,15 @@ public final class BlockData { case 2: return 3; case 3: return 0; } + } else if (type == BlockID.TRAP_DOOR) { + int open = data & 0x4; + int withoutOpen = data ^ 0x4; + switch (withoutOpen) { + case 0: return 3 | open; + case 1: return 2 | open; + case 2: return 0 | open; + case 3: return 1 | open; + } } return data; @@ -214,6 +223,15 @@ public final class BlockData { case 3: return 2; case 0: return 3; } + } else if (type == BlockID.TRAP_DOOR) { + int open = data & 0x4; + int withoutOpen = data ^ 0x4; + switch (withoutOpen) { + case 3: return 9 | open; + case 2: return 1 | open; + case 0: return 2 | open; + case 1: return 3 | open; + } } return data;