mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
Merge pull request #4 in SPIGOT/bukkit from ~GENAZT/bukkit:bugfix/SPIGOT-93 to master
* commit '3169733215adeaac5b724a7e16f46b26523e65d4': Support the new Rotation values. By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
commit
10326b1b1c
1 changed files with 18 additions and 2 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue