2020-01-22 02:02:07 +00:00
|
|
|
From 72e4471858378ddc591e391d2aae62c1937fb07d Mon Sep 17 00:00:00 2001
|
2017-07-27 03:31:58 +00: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
|
2020-01-22 02:02:07 +00:00
|
|
|
index 00000000..163ffe8f
|
2017-07-27 03:31:58 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -0,0 +1,21 @@
|
2017-07-27 03:31:58 +00:00
|
|
|
+package org.bukkit.inventory;
|
|
|
|
+
|
2019-03-20 00:28:15 +00:00
|
|
|
+import org.jetbrains.annotations.Nullable;
|
|
|
|
+
|
2018-02-08 10:07:27 +00:00
|
|
|
+public interface ArmoredHorseInventory extends AbstractHorseInventory {
|
2017-07-27 03:31:58 +00:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the item in the horse's armor slot.
|
|
|
|
+ *
|
|
|
|
+ * @return the armor item
|
|
|
|
+ */
|
2019-03-20 00:28:15 +00:00
|
|
|
+ @Nullable
|
2017-07-27 03:31:58 +00:00
|
|
|
+ ItemStack getArmor();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the item in the horse's armor slot.
|
|
|
|
+ *
|
|
|
|
+ * @param stack the new item
|
|
|
|
+ */
|
2019-03-20 00:28:15 +00:00
|
|
|
+ void setArmor(@Nullable ItemStack stack);
|
2017-07-27 03:31:58 +00:00
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java
|
2020-01-22 02:02:07 +00:00
|
|
|
index 608e99c4..53498deb 100644
|
2017-07-27 03:31:58 +00:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/HorseInventory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/HorseInventory.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -5,20 +5,4 @@ import org.jetbrains.annotations.Nullable;
|
2017-07-27 03:31:58 +00:00
|
|
|
/**
|
|
|
|
* An interface to the inventory of a Horse.
|
|
|
|
*/
|
2018-02-08 10:07:27 +00:00
|
|
|
-public interface HorseInventory extends AbstractHorseInventory {
|
2017-07-27 03:31:58 +00:00
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Gets the item in the horse's armor slot.
|
|
|
|
- *
|
|
|
|
- * @return the armor item
|
|
|
|
- */
|
2019-03-20 00:28:15 +00:00
|
|
|
- @Nullable
|
2017-07-27 03:31:58 +00:00
|
|
|
- ItemStack getArmor();
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Sets the item in the horse's armor slot.
|
|
|
|
- *
|
|
|
|
- * @param stack the new item
|
|
|
|
- */
|
2019-03-20 00:28:15 +00:00
|
|
|
- void setArmor(@Nullable ItemStack stack);
|
2017-07-27 03:31:58 +00:00
|
|
|
-}
|
2018-02-08 10:07:27 +00:00
|
|
|
+public interface HorseInventory extends AbstractHorseInventory, ArmoredHorseInventory {}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/LlamaInventory.java b/src/main/java/org/bukkit/inventory/LlamaInventory.java
|
2020-01-22 02:02:07 +00:00
|
|
|
index 2fa2c9d0..5ac1afb8 100644
|
2018-02-08 10:07:27 +00:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/LlamaInventory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/LlamaInventory.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
|
2018-02-08 10:07:27 +00:00
|
|
|
/**
|
|
|
|
* An interface to the inventory of a {@link Llama}.
|
|
|
|
*/
|
|
|
|
-public interface LlamaInventory extends AbstractHorseInventory {
|
|
|
|
+public interface LlamaInventory extends SaddledHorseInventory {
|
|
|
|
|
2019-03-20 00:28:15 +00:00
|
|
|
/**
|
2018-02-08 10:07:27 +00:00
|
|
|
* Gets the item in the llama's decor slot.
|
2017-07-27 03:31:58 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java
|
|
|
|
new file mode 100644
|
2020-01-22 02:02:07 +00:00
|
|
|
index 00000000..7944f26a
|
2017-07-27 03:31:58 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java
|
2018-02-08 10:07:27 +00:00
|
|
|
@@ -0,0 +1,3 @@
|
2017-07-27 03:31:58 +00:00
|
|
|
+package org.bukkit.inventory;
|
|
|
|
+
|
2018-02-08 10:07:27 +00:00
|
|
|
+public interface SaddledHorseInventory extends AbstractHorseInventory {}
|
2017-07-27 03:31:58 +00:00
|
|
|
--
|
2020-01-22 02:02:07 +00:00
|
|
|
2.25.0.windows.1
|
2017-07-27 03:31:58 +00:00
|
|
|
|