2019-06-14 02:27:40 +00:00
|
|
|
From bffbd646bbe2d0ccec1ec3e76227a5f0c2468bd2 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:24:06 -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/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
2019-06-06 15:36:57 +00:00
|
|
|
index 09016e3547..9952db3eb5 100644
|
2017-07-27 03:31:58 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
|
|
@@ -6,6 +6,7 @@ import net.minecraft.server.EntityHorseAbstract;
|
|
|
|
import org.apache.commons.lang.Validate;
|
|
|
|
import org.bukkit.craftbukkit.CraftServer;
|
2018-02-08 10:07:27 +00:00
|
|
|
import org.bukkit.craftbukkit.inventory.CraftInventoryAbstractHorse;
|
2017-07-27 03:31:58 +00:00
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftSaddledInventory;
|
|
|
|
import org.bukkit.entity.AbstractHorse;
|
|
|
|
import org.bukkit.entity.AnimalTamer;
|
|
|
|
import org.bukkit.entity.Horse;
|
2019-05-06 02:58:04 +00:00
|
|
|
@@ -99,6 +100,6 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
|
2017-07-27 03:31:58 +00:00
|
|
|
|
|
|
|
@Override
|
2018-02-08 10:07:27 +00:00
|
|
|
public AbstractHorseInventory getInventory() {
|
|
|
|
- return new CraftInventoryAbstractHorse(getHandle().inventoryChest);
|
2017-07-27 03:31:58 +00:00
|
|
|
+ return new CraftSaddledInventory(getHandle().inventoryChest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
2019-06-06 15:36:57 +00:00
|
|
|
index 63991bf4be..9a47a1adc1 100644
|
2017-07-27 03:31:58 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
2018-02-08 10:07:27 +00:00
|
|
|
@@ -4,7 +4,7 @@ import net.minecraft.server.IInventory;
|
2017-07-27 03:31:58 +00:00
|
|
|
import org.bukkit.inventory.HorseInventory;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
2018-02-08 10:07:27 +00:00
|
|
|
-public class CraftInventoryHorse extends CraftInventoryAbstractHorse implements HorseInventory {
|
2017-07-27 03:31:58 +00:00
|
|
|
+public class CraftInventoryHorse extends CraftSaddledInventory implements HorseInventory {
|
|
|
|
|
|
|
|
public CraftInventoryHorse(IInventory inventory) {
|
|
|
|
super(inventory);
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java
|
|
|
|
new file mode 100644
|
2019-06-06 15:36:57 +00:00
|
|
|
index 0000000000..99cfbaf90b
|
2017-07-27 03:31:58 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java
|
2018-02-08 10:07:27 +00:00
|
|
|
@@ -0,0 +1,15 @@
|
2017-07-27 03:31:58 +00:00
|
|
|
+package org.bukkit.craftbukkit.inventory;
|
|
|
|
+
|
|
|
|
+import net.minecraft.server.IInventory;
|
2018-02-08 10:07:27 +00:00
|
|
|
+
|
|
|
|
+import org.bukkit.inventory.AbstractHorseInventory;
|
2017-07-27 03:31:58 +00:00
|
|
|
+import org.bukkit.inventory.ItemStack;
|
|
|
|
+import org.bukkit.inventory.SaddledHorseInventory;
|
|
|
|
+
|
2018-02-08 10:07:27 +00:00
|
|
|
+public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory {
|
2017-07-27 03:31:58 +00:00
|
|
|
+
|
|
|
|
+ public CraftSaddledInventory(IInventory inventory) {
|
|
|
|
+ super(inventory);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
--
|
2019-03-20 01:46:00 +00:00
|
|
|
2.21.0
|
2017-07-27 03:31:58 +00:00
|
|
|
|