mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-10 22:05:10 +01:00
Support the new Rotation values.
By: Fabian Faßbender <fabian.fassbender42@googlemail.com>
This commit is contained in:
parent
b2d54f59bb
commit
3169733215
@ -11,18 +11,34 @@ public enum Rotation {
|
|||||||
* No rotation
|
* No rotation
|
||||||
*/
|
*/
|
||||||
NONE,
|
NONE,
|
||||||
|
/**
|
||||||
|
* Rotated clockwise by 45 degrees
|
||||||
|
*/
|
||||||
|
CLOCKWISE_45,
|
||||||
/**
|
/**
|
||||||
* Rotated clockwise by 90 degrees
|
* Rotated clockwise by 90 degrees
|
||||||
*/
|
*/
|
||||||
CLOCKWISE,
|
CLOCKWISE,
|
||||||
|
/**
|
||||||
|
* Rotated clockwise by 135 degrees
|
||||||
|
*/
|
||||||
|
CLOCKWISE_135,
|
||||||
/**
|
/**
|
||||||
* Flipped upside-down, a 180 degree rotation
|
* Flipped upside-down, a 180 degree rotation
|
||||||
*/
|
*/
|
||||||
FLIPPED,
|
FLIPPED,
|
||||||
|
/**
|
||||||
|
* Flipped upside-down + 45 degree rotation
|
||||||
|
*/
|
||||||
|
FLIPPED_45,
|
||||||
/**
|
/**
|
||||||
* Rotated counter-clockwise by 90 degrees
|
* Rotated counter-clockwise by 90 degrees
|
||||||
*/
|
*/
|
||||||
COUNTER_CLOCKWISE,
|
COUNTER_CLOCKWISE,
|
||||||
|
/**
|
||||||
|
* Rotated counter-clockwise by 45 degrees
|
||||||
|
*/
|
||||||
|
COUNTER_CLOCKWISE_45
|
||||||
;
|
;
|
||||||
|
|
||||||
private static final Rotation [] rotations = values();
|
private static final Rotation [] rotations = values();
|
||||||
@ -33,7 +49,7 @@ public enum Rotation {
|
|||||||
* @return the relative rotation
|
* @return the relative rotation
|
||||||
*/
|
*/
|
||||||
public Rotation rotateClockwise() {
|
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
|
* @return the relative rotation
|
||||||
*/
|
*/
|
||||||
public Rotation rotateCounterClockwise() {
|
public Rotation rotateCounterClockwise() {
|
||||||
return rotations[(this.ordinal() - 1) & 0x3];
|
return rotations[(this.ordinal() - 1) & 0x7];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user