Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Added extra rotations for 1.8 #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/main/java/org/bukkit/Rotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,40 @@
* An enum to specify a rotation based orientation, like that on a clock.
* <p>
* It represents how something is viewed, as opposed to cardinal directions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing documentation on deprecation reason.

/**
 * ...
 * @deprecated This does not handle the various degrees of rotation available
 */

*
* @deprecated This does not handle the various degrees of rotation available
*/
@Deprecated
public enum Rotation {

/**
* No rotation
*/
NONE,
NONE(0),
/**
* Rotated clockwise by 90 degrees
*/
CLOCKWISE,
CLOCKWISE(90),
/**
* Flipped upside-down, a 180 degree rotation
*/
FLIPPED,
FLIPPED(180),
/**
* Rotated counter-clockwise by 90 degrees
*/
COUNTER_CLOCKWISE,
COUNTER_CLOCKWISE(270),
;

private double rotation;

private Rotation(double rotation) {
this.rotation = rotation;
}

public double getRotation() {
return rotation;
}

private static final Rotation [] rotations = values();

/**
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/org/bukkit/entity/ItemFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,35 @@ public interface ItemFrame extends Hanging {
/**
* Get the rotation of the frame's item
*
* @deprecated This does not handle the various degrees of rotation available.
* @return the direction
*/
@Deprecated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing documentation for deprecation (see last comment)

public Rotation getRotation();

/**
* Get the rotation of the frame's item
*
* @return the rotation, in degrees
*/
public double getRotationAngle();

/**
* Set the rotation of the frame's item
*
* @param rotation the new rotation
* @deprecated This does not handle the various degrees of rotation available.
* @throws IllegalArgumentException if rotation is null
*/
@Deprecated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing documentation for deprecation (see last comment)

public void setRotation(Rotation rotation) throws IllegalArgumentException;

/**
* Set the rotation of the frame's item, in degrees
*
* Values will be rounded to the closest 45-degree interval
*
* @param rotation the new rotation (0 degrees is north)
*/
public void setRotationAngle(double rotation);
}