mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
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.
This commit is contained in:
parent
760d9e300f
commit
90c776d3aa
@ -5,6 +5,7 @@ import java.util.UUID;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
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;
|
||||
@ -107,6 +108,6 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
|
||||
|
||||
@Override
|
||||
public AbstractHorseInventory getInventory() {
|
||||
return new CraftInventoryAbstractHorse(this.getHandle().inventory);
|
||||
return new CraftSaddledInventory(getHandle().inventory);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
private final Container bodyArmorInventory;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user