From 63fa72af5e3233721d06cda92e9d8419cc414759 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 25 Sep 2011 06:01:01 +0200 Subject: [PATCH] Added rotate code for brick and stone brick stairs and made powered/detector rails not lose their charge when rotating. --- .../com/sk89q/worldedit/data/BlockData.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/data/BlockData.java b/src/main/java/com/sk89q/worldedit/data/BlockData.java index 46a1fcf49..f348978ca 100644 --- a/src/main/java/com/sk89q/worldedit/data/BlockData.java +++ b/src/main/java/com/sk89q/worldedit/data/BlockData.java @@ -60,17 +60,19 @@ public final class BlockData { case BlockID.POWERED_RAIL: case BlockID.DETECTOR_RAIL: switch (data & 0x7) { - case 0: return 1; - case 1: return 0; - case 2: return 5; - case 3: return 4; - case 4: return 2; - case 5: return 3; + case 0: return 1 | (data & ~0x7); + case 1: return 0 | (data & ~0x7); + case 2: return 5 | (data & ~0x7); + case 3: return 4 | (data & ~0x7); + case 4: return 2 | (data & ~0x7); + case 5: return 3 | (data & ~0x7); } break; case BlockID.WOODEN_STAIRS: case BlockID.COBBLESTONE_STAIRS: + case BlockID.BRICK_STAIRS: + case BlockID.STONE_BRICK_STAIRS: switch (data) { case 0: return 2; case 1: return 3; @@ -215,17 +217,19 @@ public final class BlockData { case BlockID.POWERED_RAIL: case BlockID.DETECTOR_RAIL: switch (data & 0x7) { - case 1: return 0; - case 0: return 1; - case 5: return 2; - case 4: return 3; - case 2: return 4; - case 3: return 5; + case 1: return 0 | (data & ~0x7); + case 0: return 1 | (data & ~0x7); + case 5: return 2 | (data & ~0x7); + case 4: return 3 | (data & ~0x7); + case 2: return 4 | (data & ~0x7); + case 3: return 5 | (data & ~0x7); } break; case BlockID.WOODEN_STAIRS: case BlockID.COBBLESTONE_STAIRS: + case BlockID.BRICK_STAIRS: + case BlockID.STONE_BRICK_STAIRS: switch (data) { case 2: return 0; case 3: return 1;