From 3169733215adeaac5b724a7e16f46b26523e65d4 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 2 Dec 2014 00:02:30 +0100 Subject: [PATCH] Support the new Rotation values. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By: Fabian Faßbender --- .../src/main/java/org/bukkit/Rotation.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/Rotation.java b/paper-api/src/main/java/org/bukkit/Rotation.java index dfdb0e5a13..5d059eaeb3 100644 --- a/paper-api/src/main/java/org/bukkit/Rotation.java +++ b/paper-api/src/main/java/org/bukkit/Rotation.java @@ -11,18 +11,34 @@ public enum Rotation { * No rotation */ NONE, + /** + * Rotated clockwise by 45 degrees + */ + CLOCKWISE_45, /** * Rotated clockwise by 90 degrees */ CLOCKWISE, + /** + * Rotated clockwise by 135 degrees + */ + CLOCKWISE_135, /** * Flipped upside-down, a 180 degree rotation */ FLIPPED, + /** + * Flipped upside-down + 45 degree rotation + */ + FLIPPED_45, /** * Rotated counter-clockwise by 90 degrees */ COUNTER_CLOCKWISE, + /** + * Rotated counter-clockwise by 45 degrees + */ + COUNTER_CLOCKWISE_45 ; private static final Rotation [] rotations = values(); @@ -33,7 +49,7 @@ public enum Rotation { * @return the relative rotation */ public Rotation rotateClockwise() { - return rotations[(this.ordinal() + 1) & 0x3]; + return rotations[(this.ordinal() + 1) & 0x7]; } /** @@ -42,6 +58,6 @@ public enum Rotation { * @return the relative rotation */ public Rotation rotateCounterClockwise() { - return rotations[(this.ordinal() - 1) & 0x3]; + return rotations[(this.ordinal() - 1) & 0x7]; } }