summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-01-28 09:55:09 +1100
committermd_5 <git@md-5.net>2018-01-28 09:55:09 +1100
commit9bd34e7b7a0141e159dc786feca77847f01366dd (patch)
tree93558aba8f349b10b53cfce694f2147251d32983
parent2b1f48cd2c88434401001efcae22b0de9f61ba37 (diff)
downloadbukkit-9bd34e7b7a0141e159dc786feca77847f01366dd.tar
bukkit-9bd34e7b7a0141e159dc786feca77847f01366dd.tar.gz
bukkit-9bd34e7b7a0141e159dc786feca77847f01366dd.tar.lz
bukkit-9bd34e7b7a0141e159dc786feca77847f01366dd.tar.xz
bukkit-9bd34e7b7a0141e159dc786feca77847f01366dd.zip
SPIGOT-2911: Implement AbstractHorseInventory
-rw-r--r--src/main/java/org/bukkit/entity/AbstractHorse.java4
-rw-r--r--src/main/java/org/bukkit/inventory/AbstractHorseInventory.java23
-rw-r--r--src/main/java/org/bukkit/inventory/HorseInventory.java16
-rw-r--r--src/main/java/org/bukkit/inventory/LlamaInventory.java2
4 files changed, 29 insertions, 16 deletions
diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java
index 0e615711..10757454 100644
--- a/src/main/java/org/bukkit/entity/AbstractHorse.java
+++ b/src/main/java/org/bukkit/entity/AbstractHorse.java
@@ -1,5 +1,6 @@
package org.bukkit.entity;
+import org.bukkit.inventory.AbstractHorseInventory;
import org.bukkit.inventory.InventoryHolder;
/**
@@ -96,4 +97,7 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab
* @param strength jump strength for this horse
*/
public void setJumpStrength(double strength);
+
+ @Override
+ public AbstractHorseInventory getInventory();
}
diff --git a/src/main/java/org/bukkit/inventory/AbstractHorseInventory.java b/src/main/java/org/bukkit/inventory/AbstractHorseInventory.java
new file mode 100644
index 00000000..4c16e34a
--- /dev/null
+++ b/src/main/java/org/bukkit/inventory/AbstractHorseInventory.java
@@ -0,0 +1,23 @@
+package org.bukkit.inventory;
+
+import org.bukkit.entity.AbstractHorse;
+
+/**
+ * An interface to the inventory of an {@link AbstractHorse}.
+ */
+public interface AbstractHorseInventory extends Inventory {
+
+ /**
+ * Gets the item in the horse's saddle slot.
+ *
+ * @return the saddle item
+ */
+ ItemStack getSaddle();
+
+ /**
+ * Sets the item in the horse's saddle slot.
+ *
+ * @param stack the new item
+ */
+ void setSaddle(ItemStack stack);
+}
diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java
index a71efb83..a73c9850 100644
--- a/src/main/java/org/bukkit/inventory/HorseInventory.java
+++ b/src/main/java/org/bukkit/inventory/HorseInventory.java
@@ -3,14 +3,7 @@ package org.bukkit.inventory;
/**
* An interface to the inventory of a Horse.
*/
-public interface HorseInventory extends Inventory {
-
- /**
- * Gets the item in the horse's saddle slot.
- *
- * @return the saddle item
- */
- ItemStack getSaddle();
+public interface HorseInventory extends AbstractHorseInventory {
/**
* Gets the item in the horse's armor slot.
@@ -20,13 +13,6 @@ public interface HorseInventory extends Inventory {
ItemStack getArmor();
/**
- * Sets the item in the horse's saddle slot.
- *
- * @param stack the new item
- */
- void setSaddle(ItemStack stack);
-
- /**
* Sets the item in the horse's armor slot.
*
* @param stack the new item
diff --git a/src/main/java/org/bukkit/inventory/LlamaInventory.java b/src/main/java/org/bukkit/inventory/LlamaInventory.java
index 406fb18f..9b3dcf3f 100644
--- a/src/main/java/org/bukkit/inventory/LlamaInventory.java
+++ b/src/main/java/org/bukkit/inventory/LlamaInventory.java
@@ -5,7 +5,7 @@ import org.bukkit.entity.Llama;
/**
* An interface to the inventory of a {@link Llama}.
*/
-public interface LlamaInventory extends Inventory {
+public interface LlamaInventory extends AbstractHorseInventory {
/*
* Gets the item in the llama's decor slot.