summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/Nameable.java28
-rw-r--r--src/main/java/org/bukkit/block/Beacon.java3
-rw-r--r--src/main/java/org/bukkit/block/BrewingStand.java3
-rw-r--r--src/main/java/org/bukkit/block/Chest.java3
-rw-r--r--src/main/java/org/bukkit/block/Dispenser.java3
-rw-r--r--src/main/java/org/bukkit/block/Dropper.java4
-rw-r--r--src/main/java/org/bukkit/block/Furnace.java3
-rw-r--r--src/main/java/org/bukkit/block/Hopper.java5
-rw-r--r--src/main/java/org/bukkit/block/ShulkerBox.java12
-rw-r--r--src/main/java/org/bukkit/entity/Entity.java27
10 files changed, 56 insertions, 35 deletions
diff --git a/src/main/java/org/bukkit/Nameable.java b/src/main/java/org/bukkit/Nameable.java
new file mode 100644
index 00000000..49cf519c
--- /dev/null
+++ b/src/main/java/org/bukkit/Nameable.java
@@ -0,0 +1,28 @@
+package org.bukkit;
+
+public interface Nameable {
+
+ /**
+ * Gets the custom name on a mob or block. If there is no name this method
+ * will return null.
+ * <p>
+ * This value has no effect on players, they will always use their real
+ * name.
+ *
+ * @return name of the mob/block or null
+ */
+ public String getCustomName();
+
+ /**
+ * Sets a custom name on a mob or block. This name will be used in death
+ * messages and can be sent to the client as a nameplate over the mob.
+ * <p>
+ * Setting the name to null or an empty string will clear it.
+ * <p>
+ * This value has no effect on players, they will always use their real
+ * name.
+ *
+ * @param name the name to set
+ */
+ public void setCustomName(String name);
+}
diff --git a/src/main/java/org/bukkit/block/Beacon.java b/src/main/java/org/bukkit/block/Beacon.java
index a3af3510..b1f97c9f 100644
--- a/src/main/java/org/bukkit/block/Beacon.java
+++ b/src/main/java/org/bukkit/block/Beacon.java
@@ -1,6 +1,7 @@
package org.bukkit.block;
import java.util.Collection;
+import org.bukkit.Nameable;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.potion.PotionEffect;
@@ -9,7 +10,7 @@ import org.bukkit.potion.PotionEffectType;
/**
* Represents a beacon.
*/
-public interface Beacon extends BlockState, InventoryHolder, Lockable {
+public interface Beacon extends BlockState, InventoryHolder, Lockable, Nameable {
/**
* Returns the list of players within the beacon's range of effect.
diff --git a/src/main/java/org/bukkit/block/BrewingStand.java b/src/main/java/org/bukkit/block/BrewingStand.java
index 7bc809de..ea6ff4e1 100644
--- a/src/main/java/org/bukkit/block/BrewingStand.java
+++ b/src/main/java/org/bukkit/block/BrewingStand.java
@@ -1,12 +1,13 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.BrewerInventory;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a brewing stand.
*/
-public interface BrewingStand extends BlockState, InventoryHolder, Lockable {
+public interface BrewingStand extends BlockState, InventoryHolder, Lockable, Nameable {
/**
* How much time is left in the brewing cycle
diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java
index e941d8bd..ade09ddd 100644
--- a/src/main/java/org/bukkit/block/Chest.java
+++ b/src/main/java/org/bukkit/block/Chest.java
@@ -1,12 +1,13 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a chest.
*/
-public interface Chest extends BlockState, InventoryHolder, Lockable {
+public interface Chest extends BlockState, InventoryHolder, Lockable, Nameable {
/**
* Returns the chest's inventory. If this is a double chest, it returns
diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java
index 94d360b3..39ee9b04 100644
--- a/src/main/java/org/bukkit/block/Dispenser.java
+++ b/src/main/java/org/bukkit/block/Dispenser.java
@@ -1,12 +1,13 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.projectiles.BlockProjectileSource;
/**
* Represents a dispenser.
*/
-public interface Dispenser extends BlockState, InventoryHolder, Lockable {
+public interface Dispenser extends BlockState, InventoryHolder, Lockable, Nameable {
/**
* Gets the BlockProjectileSource object for this dispenser.
diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java
index 4d3a5036..0f1013bd 100644
--- a/src/main/java/org/bukkit/block/Dropper.java
+++ b/src/main/java/org/bukkit/block/Dropper.java
@@ -1,11 +1,13 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a dropper.
*/
-public interface Dropper extends BlockState, InventoryHolder, Lockable {
+public interface Dropper extends BlockState, InventoryHolder, Lockable, Nameable {
+
/**
* Tries to drop a randomly selected item from the Dropper's inventory,
* following the normal behavior of a Dropper.
diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java
index d943e34f..b077eb37 100644
--- a/src/main/java/org/bukkit/block/Furnace.java
+++ b/src/main/java/org/bukkit/block/Furnace.java
@@ -1,12 +1,13 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.FurnaceInventory;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a furnace.
*/
-public interface Furnace extends BlockState, InventoryHolder, Lockable {
+public interface Furnace extends BlockState, InventoryHolder, Lockable, Nameable {
/**
* Get burn time.
diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java
index 978cf2a7..8e5e3e89 100644
--- a/src/main/java/org/bukkit/block/Hopper.java
+++ b/src/main/java/org/bukkit/block/Hopper.java
@@ -1,10 +1,9 @@
package org.bukkit.block;
+import org.bukkit.Nameable;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a hopper.
*/
-public interface Hopper extends BlockState, InventoryHolder, Lockable {
-
-}
+public interface Hopper extends BlockState, InventoryHolder, Lockable, Nameable { }
diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java
index c58711ce..003cfb8a 100644
--- a/src/main/java/org/bukkit/block/ShulkerBox.java
+++ b/src/main/java/org/bukkit/block/ShulkerBox.java
@@ -1,8 +1,18 @@
package org.bukkit.block;
+import org.bukkit.DyeColor;
+import org.bukkit.Nameable;
import org.bukkit.inventory.InventoryHolder;
/**
* Represents a ShulkerBox.
*/
-public interface ShulkerBox extends BlockState, InventoryHolder, Lockable { }
+public interface ShulkerBox extends BlockState, InventoryHolder, Lockable, Nameable {
+
+ /**
+ * Get the {@link DyeColor} corresponding to this ShulkerBox
+ *
+ * @return the {@link DyeColor} of this ShulkerBox
+ */
+ public DyeColor getColor();
+}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 38d665a3..759e3f0d 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;
import org.bukkit.Location;
import org.bukkit.EntityEffect;
+import org.bukkit.Nameable;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.event.entity.EntityDamageEvent;
@@ -17,7 +18,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
/**
* Represents a base entity in the world
*/
-public interface Entity extends Metadatable, CommandSender {
+public interface Entity extends Metadatable, CommandSender, Nameable {
/**
* Gets the entity's current position
@@ -300,30 +301,6 @@ public interface Entity extends Metadatable, CommandSender {
public Entity getVehicle();
/**
- * Sets a custom name on a mob. This name will be used in death messages
- * and can be sent to the client as a nameplate over the mob.
- * <p>
- * Setting the name to null or an empty string will clear it.
- * <p>
- * This value has no effect on players, they will always use their real
- * name.
- *
- * @param name the name to set
- */
- public void setCustomName(String name);
-
- /**
- * Gets the custom name on a mob. If there is no name this method will
- * return null.
- * <p>
- * This value has no effect on players, they will always use their real
- * name.
- *
- * @return name of the mob or null
- */
- public String getCustomName();
-
- /**
* Sets whether or not to display the mob's custom name client side. The
* name will be displayed above the mob similarly to a player.
* <p>