2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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: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
|
2021-03-16 08:19:45 +01:00
|
|
|
index 00b97d9ee7a3dd622c87e8efa288795d34db8fc7..62ccef35e4b4238c50faf778fbf3ea9a494ca387 100644
|
2017-07-27 05:31:58 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
2021-03-16 08:19:45 +01:00
|
|
|
@@ -6,6 +6,7 @@ import net.minecraft.world.entity.animal.horse.EntityHorseAbstract;
|
2017-07-27 05:31:58 +02:00
|
|
|
import org.apache.commons.lang.Validate;
|
|
|
|
import org.bukkit.craftbukkit.CraftServer;
|
2018-02-08 11:07:27 +01:00
|
|
|
import org.bukkit.craftbukkit.inventory.CraftInventoryAbstractHorse;
|
2017-07-27 05:31:58 +02: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 04:58:04 +02:00
|
|
|
@@ -99,6 +100,6 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
|
2017-07-27 05:31:58 +02:00
|
|
|
|
|
|
|
@Override
|
2018-02-08 11:07:27 +01:00
|
|
|
public AbstractHorseInventory getInventory() {
|
|
|
|
- return new CraftInventoryAbstractHorse(getHandle().inventoryChest);
|
2017-07-27 05:31:58 +02: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
|
2021-03-16 08:19:45 +01:00
|
|
|
index c3599b29c0b32d6fcf18a4a0adfbe8454c37834d..0389d15f8e0b6bb68316eaed0cf91acab8951cc7 100644
|
2017-07-27 05:31:58 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
2021-03-16 08:19:45 +01:00
|
|
|
@@ -4,7 +4,7 @@ import net.minecraft.world.IInventory;
|
2017-07-27 05:31:58 +02:00
|
|
|
import org.bukkit.inventory.HorseInventory;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
2018-02-08 11:07:27 +01:00
|
|
|
-public class CraftInventoryHorse extends CraftInventoryAbstractHorse implements HorseInventory {
|
2017-07-27 05:31:58 +02: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
|
2021-03-16 14:04:28 +01:00
|
|
|
index 0000000000000000000000000000000000000000..8c2674ca1be1346ea84bcd7c9c5d6ea540802a5f
|
2017-07-27 05:31:58 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java
|
2021-03-16 14:04:28 +01:00
|
|
|
@@ -0,0 +1,12 @@
|
2017-07-27 05:31:58 +02:00
|
|
|
+package org.bukkit.craftbukkit.inventory;
|
|
|
|
+
|
2021-03-16 14:04:28 +01:00
|
|
|
+import net.minecraft.world.IInventory;
|
2017-07-27 05:31:58 +02:00
|
|
|
+import org.bukkit.inventory.SaddledHorseInventory;
|
|
|
|
+
|
2018-02-08 11:07:27 +01:00
|
|
|
+public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory {
|
2017-07-27 05:31:58 +02:00
|
|
|
+
|
|
|
|
+ public CraftSaddledInventory(IInventory inventory) {
|
|
|
|
+ super(inventory);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|