2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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
|
2024-04-24 03:25:14 +02:00
|
|
|
index 3b7a355945adbc671b1c3b6381e6fbbcb9fe7294..5192fa2aeba7833fca456bded0deedde7de03506 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
2023-06-13 01:51:45 +02:00
|
|
|
@@ -5,6 +5,7 @@ import java.util.UUID;
|
|
|
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
2021-06-11 14:02:28 +02:00
|
|
|
import org.bukkit.craftbukkit.CraftServer;
|
|
|
|
import org.bukkit.craftbukkit.inventory.CraftInventoryAbstractHorse;
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftSaddledInventory;
|
|
|
|
import org.bukkit.entity.AbstractHorse;
|
|
|
|
import org.bukkit.entity.AnimalTamer;
|
|
|
|
import org.bukkit.entity.Horse;
|
2023-06-13 01:51:45 +02:00
|
|
|
@@ -107,6 +108,6 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public AbstractHorseInventory getInventory() {
|
2021-06-12 13:18:01 +02:00
|
|
|
- return new CraftInventoryAbstractHorse(this.getHandle().inventory);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ return new CraftSaddledInventory(getHandle().inventory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
2024-05-11 23:48:37 +02:00
|
|
|
index 5686c13b77f1c18b7d690859c6bea4f7b721ef13..07a304edc2a7b3450a55728e78a4fe37febdbadc 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
|
|
@@ -4,7 +4,7 @@ import net.minecraft.world.Container;
|
|
|
|
import org.bukkit.inventory.HorseInventory;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
|
|
-public class CraftInventoryHorse extends CraftInventoryAbstractHorse implements HorseInventory {
|
|
|
|
+public class CraftInventoryHorse extends CraftSaddledInventory implements HorseInventory {
|
|
|
|
|
2024-05-11 23:48:37 +02:00
|
|
|
private final Container bodyArmorInventory;
|
|
|
|
|
2021-06-11 14:02:28 +02:00
|
|
|
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
|
|
|
|
index 0000000000000000000000000000000000000000..3a617c07d445bacf5a13e0e3ff6481823cfc8477
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java
|
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
+package org.bukkit.craftbukkit.inventory;
|
|
|
|
+
|
|
|
|
+import net.minecraft.world.Container;
|
|
|
|
+import org.bukkit.inventory.SaddledHorseInventory;
|
|
|
|
+
|
|
|
|
+public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory {
|
|
|
|
+
|
|
|
|
+ public CraftSaddledInventory(Container inventory) {
|
|
|
|
+ super(inventory);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|