From 696a2819a704220d91181ef5dac503d55b736d8b Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Tue, 1 Oct 2013 23:43:24 +0200 Subject: [PATCH] Fixed head rotation. --- .../com/sk89q/worldedit/blocks/BlockData.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockData.java b/src/main/java/com/sk89q/worldedit/blocks/BlockData.java index 6a7dc324d..49479c7e0 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockData.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockData.java @@ -231,6 +231,14 @@ public static int rotate90(int type, int data) { case BlockID.BED: return data & ~0x3 | (data + 1) & 0x3; + + case BlockID.HEAD: + switch (data) { + case 2: return 5; + case 3: return 4; + case 4: return 2; + case 5: return 3; + } } return data; @@ -441,6 +449,14 @@ public static int rotate90Reverse(int type, int data) { case BlockID.BED: return data & ~0x3 | (data - 1) & 0x3; + + case BlockID.HEAD: + switch (data) { + case 2: return 4; + case 3: return 5; + case 4: return 3; + case 5: return 2; + } } return data; @@ -735,6 +751,17 @@ public static int flip(int type, int data, FlipDirection direction) { return data ^ flipX << 1; } break; + + case BlockID.HEAD: + switch (data) { + case 2: + case 3: + return data ^ flipZ; + case 4: + case 5: + return data ^ flipX; + } + break; } return data;