diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java index 62c7d44c75..14d0416802 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -5,11 +5,11 @@ import net.minecraft.server.EntityHorse; import net.minecraft.server.EntityHorseAbstract; import org.apache.commons.lang.Validate; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.inventory.CraftInventory; +import org.bukkit.craftbukkit.inventory.CraftInventoryAbstractHorse; import org.bukkit.entity.AbstractHorse; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.Horse; -import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.AbstractHorseInventory; public abstract class CraftAbstractHorse extends CraftAnimals implements AbstractHorse { @@ -91,7 +91,7 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac } @Override - public Inventory getInventory() { - return new CraftInventory(getHandle().inventoryChest); + public AbstractHorseInventory getInventory() { + return new CraftInventoryAbstractHorse(getHandle().inventoryChest); } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java new file mode 100644 index 0000000000..b7793caa2c --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java @@ -0,0 +1,22 @@ +package org.bukkit.craftbukkit.inventory; + +import net.minecraft.server.IInventory; +import org.bukkit.inventory.AbstractHorseInventory; +import org.bukkit.inventory.ItemStack; + +public class CraftInventoryAbstractHorse extends CraftInventory implements AbstractHorseInventory { + + public CraftInventoryAbstractHorse(IInventory inventory) { + super(inventory); + } + + @Override + public ItemStack getSaddle() { + return getItem(0); + } + + @Override + public void setSaddle(ItemStack stack) { + setItem(0, stack); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java index 5adbd7437e..173818e682 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java @@ -4,24 +4,16 @@ import net.minecraft.server.IInventory; import org.bukkit.inventory.HorseInventory; import org.bukkit.inventory.ItemStack; -public class CraftInventoryHorse extends CraftInventory implements HorseInventory { +public class CraftInventoryHorse extends CraftInventoryAbstractHorse implements HorseInventory { public CraftInventoryHorse(IInventory inventory) { super(inventory); } - public ItemStack getSaddle() { - return getItem(0); - } - public ItemStack getArmor() { return getItem(1); } - public void setSaddle(ItemStack stack) { - setItem(0, stack); - } - public void setArmor(ItemStack stack) { setItem(1, stack); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java index 342b74ae61..c910f5e9c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java @@ -4,7 +4,7 @@ import net.minecraft.server.IInventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.LlamaInventory; -public class CraftInventoryLlama extends CraftInventory implements LlamaInventory { +public class CraftInventoryLlama extends CraftInventoryAbstractHorse implements LlamaInventory { public CraftInventoryLlama(IInventory inventory) { super(inventory);