Add API for ItemFrames. Adds BUKKIT-2668

As well as adding methods for ItemFrames, this moves some methods
previously contained in Painting to Hanging, as they are shared by both
classes.

An enum was added that represents rotations, similar to a clock-face.
This is needed as a contrast to cardinal direction based rotations.

By: h31ix <effectsdude@gmail.com>
This commit is contained in:
Bukkit/Spigot
2012-10-31 01:01:45 -04:00
parent 397b53dad5
commit 086b2ecbdc
4 changed files with 95 additions and 15 deletions

View File

@@ -1,6 +1,39 @@
package org.bukkit.entity;
import org.bukkit.Rotation;
import org.bukkit.inventory.ItemStack;
/**
* Represents an Item Frame
*/
public interface ItemFrame extends Hanging {}
public interface ItemFrame extends Hanging {
/**
* Get the item in this frame
*
* @return a defensive copy the item in this item frame
*/
public ItemStack getItem();
/**
* Set the item in this frame
*
* @param item the new item
*/
public void setItem(ItemStack item);
/**
* Get the rotation of the frame's item
*
* @return the direction
*/
public Rotation getRotation();
/**
* Set the rotation of the frame's item
*
* @param rotation the new rotation
* @throws IllegalArgumentException if rotation is null
*/
public void setRotation(Rotation rotation) throws IllegalArgumentException;
}