summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorFabian Faßbender <fabian.fassbender42@googlemail.com>2014-12-02 00:02:30 +0100
committerFabian Faßbender <fabian.fassbender42@googlemail.com>2014-12-02 00:02:30 +0100
commitb6c156daa6d98920e14f04b68a88692e5cef602c (patch)
treebbefa07d84f5e6d77f78f06e662c9fe1a606bedc /src/main
parent2a18a07d91519a2af96dc04fe7a5d3787ffe7b73 (diff)
downloadbukkit-b6c156daa6d98920e14f04b68a88692e5cef602c.tar
bukkit-b6c156daa6d98920e14f04b68a88692e5cef602c.tar.gz
bukkit-b6c156daa6d98920e14f04b68a88692e5cef602c.tar.lz
bukkit-b6c156daa6d98920e14f04b68a88692e5cef602c.tar.xz
bukkit-b6c156daa6d98920e14f04b68a88692e5cef602c.zip
Support the new Rotation values.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/Rotation.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/Rotation.java b/src/main/java/org/bukkit/Rotation.java
index dfdb0e5a..5d059eae 100644
--- a/src/main/java/org/bukkit/Rotation.java
+++ b/src/main/java/org/bukkit/Rotation.java
@@ -12,17 +12,33 @@ public enum 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];
}
}