mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
7a5a4fd400
This makes it easier for downstream projects (forks) to replace the version fetching system with their own. It is as simple as implementing an interface and overriding the default implementation of org.bukkit.UnsafeValues#getVersionFetcher() It also makes it easier for us to organize things like the version history feature. Lastly I have updated the paper implementation to check against the site API rather than against jenkins.
63 lines
No EOL
2.9 KiB
Diff
63 lines
No EOL
2.9 KiB
Diff
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
|
|
index 09016e354..9952db3eb 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.server.EntityHorseAbstract;
|
|
import org.apache.commons.lang.Validate;
|
|
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;
|
|
@@ -0,0 +0,0 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
|
|
|
|
@Override
|
|
public AbstractHorseInventory getInventory() {
|
|
- return new CraftInventoryAbstractHorse(getHandle().inventoryChest);
|
|
+ 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
|
|
index 63991bf4b..9a47a1adc 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.server.IInventory;
|
|
import org.bukkit.inventory.HorseInventory;
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
-public class CraftInventoryHorse extends CraftInventoryAbstractHorse implements HorseInventory {
|
|
+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
|
|
index 000000000..99cfbaf90
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java
|
|
@@ -0,0 +0,0 @@
|
|
+package org.bukkit.craftbukkit.inventory;
|
|
+
|
|
+import net.minecraft.server.IInventory;
|
|
+
|
|
+import org.bukkit.inventory.AbstractHorseInventory;
|
|
+import org.bukkit.inventory.ItemStack;
|
|
+import org.bukkit.inventory.SaddledHorseInventory;
|
|
+
|
|
+public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory {
|
|
+
|
|
+ public CraftSaddledInventory(IInventory inventory) {
|
|
+ super(inventory);
|
|
+ }
|
|
+
|
|
+}
|
|
--
|