2018-01-16 04:13:17 +01:00
|
|
|
From ff1048377c614b8a6f32c6d32d80b8ef8183650f Mon Sep 17 00:00:00 2001
|
2017-07-27 05:31:58 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 10 Dec 2016 16:12:48 -0500
|
|
|
|
Subject: [PATCH] Improve the Saddle API for Horses
|
|
|
|
|
|
|
|
Not all horses with Saddles have armor. This lets us break up the horses with saddles
|
|
|
|
and access their saddle state separately from an interface shared with Armor.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java
|
|
|
|
new file mode 100644
|
|
|
|
index 00000000..037479de
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java
|
|
|
|
@@ -0,0 +1,18 @@
|
|
|
|
+package org.bukkit.inventory;
|
|
|
|
+
|
|
|
|
+public interface ArmoredHorseInventory extends Inventory {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the item in the horse's armor slot.
|
|
|
|
+ *
|
|
|
|
+ * @return the armor item
|
|
|
|
+ */
|
|
|
|
+ ItemStack getArmor();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the item in the horse's armor slot.
|
|
|
|
+ *
|
|
|
|
+ * @param stack the new item
|
|
|
|
+ */
|
|
|
|
+ void setArmor(ItemStack stack);
|
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java
|
|
|
|
index a71efb83..b4b95ab5 100644
|
|
|
|
--- a/src/main/java/org/bukkit/inventory/HorseInventory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/HorseInventory.java
|
|
|
|
@@ -3,33 +3,4 @@ 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();
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Gets the item in the horse's armor slot.
|
|
|
|
- *
|
|
|
|
- * @return the armor item
|
|
|
|
- */
|
|
|
|
- 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
|
|
|
|
- */
|
|
|
|
- void setArmor(ItemStack stack);
|
|
|
|
-}
|
|
|
|
+public interface HorseInventory extends ArmoredHorseInventory, SaddledHorseInventory {}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java
|
|
|
|
new file mode 100644
|
|
|
|
index 00000000..010dc364
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java
|
|
|
|
@@ -0,0 +1,18 @@
|
|
|
|
+package org.bukkit.inventory;
|
|
|
|
+
|
|
|
|
+public interface SaddledHorseInventory {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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);
|
|
|
|
+}
|
|
|
|
--
|
2018-01-16 04:13:17 +01:00
|
|
|
2.15.1
|
2017-07-27 05:31:58 +02:00
|
|
|
|