From 7053beb77654370bc781ab9368cc5246a2bfe7d9 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 20 Dec 2012 17:46:21 -0500 Subject: [PATCH] Add Skull BlockState and Type enum. Adds BUKKIT-3258 By: meiskam --- .../src/main/java/org/bukkit/SkullType.java | 12 ++++ .../src/main/java/org/bukkit/block/Skull.java | 59 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/SkullType.java create mode 100644 paper-api/src/main/java/org/bukkit/block/Skull.java diff --git a/paper-api/src/main/java/org/bukkit/SkullType.java b/paper-api/src/main/java/org/bukkit/SkullType.java new file mode 100644 index 0000000000..5647241d97 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/SkullType.java @@ -0,0 +1,12 @@ +package org.bukkit; + +/** + * Represents the types of skulls + */ +public enum SkullType { + SKELETON, + WITHER, + ZOMBIE, + PLAYER, + CREEPER; +} diff --git a/paper-api/src/main/java/org/bukkit/block/Skull.java b/paper-api/src/main/java/org/bukkit/block/Skull.java new file mode 100644 index 0000000000..e5ee6b6e55 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/block/Skull.java @@ -0,0 +1,59 @@ +package org.bukkit.block; + +import org.bukkit.SkullType; + +/** + * Represents a Skull + */ +public interface Skull extends BlockState { + + /** + * Checks to see if the skull has an owner + * + * @return true if the skull has an owner + */ + public boolean hasOwner(); + + /** + * Gets the owner of the skull + * + * @return the owner if the skull + */ + public String getOwner(); + + /** + * Sets the owner of the skull + * + * @param owner the new owner of the skull + * @return true if the owner was successfully set + */ + public boolean setOwner(String name); + + /** + * Gets the rotation of the skull + * + * @return the rotation of the skull + */ + public BlockFace getRotation(); + + /** + * Sets the rotation of the skull + * + * @param rotation the rotation of the skull + */ + public void setRotation(BlockFace rotation); + + /** + * Gets the type of skull + * + * @return the type of skull + */ + public SkullType getSkullType(); + + /** + * Sets the type of skull + * + * @param skullType the type of skull + */ + public void setSkullType(SkullType skullType); +}