diff options
author | Wesley Wolfe <weswolf@aol.com> | 2013-07-25 18:04:09 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-07-25 18:04:09 -0500 |
commit | 5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282 (patch) | |
tree | cfedc4a82e9939cace8262eaf3b16b0650c8a566 /src/main | |
parent | 0a9758ae548c03938be2e3e41cdd6f0fc1db8183 (diff) | |
download | craftbukkit-5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282.tar craftbukkit-5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282.tar.gz craftbukkit-5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282.tar.lz craftbukkit-5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282.tar.xz craftbukkit-5bfd599e9fa2ec8daa92e5c3df04a4b2fb63c282.zip |
Store owning Horse in horse inventory. Fixes BUKKIT-4586
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityHorse.java | 2 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/InventoryHorseChest.java | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java index fb411ed4..bc7acb97 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java @@ -328,7 +328,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void cH() { // CraftBukkit - private -> public InventoryHorseChest inventoryhorsechest = this.inventoryChest; - this.inventoryChest = new InventoryHorseChest("HorseChest", this.cG()); + this.inventoryChest = new InventoryHorseChest("HorseChest", this.cG(), this); // CraftBukkit - add this horse this.inventoryChest.a(this.getLocalizedName()); if (inventoryhorsechest != null) { inventoryhorsechest.b(this); diff --git a/src/main/java/net/minecraft/server/InventoryHorseChest.java b/src/main/java/net/minecraft/server/InventoryHorseChest.java index 1fa3d5f4..d3a5ebe4 100644 --- a/src/main/java/net/minecraft/server/InventoryHorseChest.java +++ b/src/main/java/net/minecraft/server/InventoryHorseChest.java @@ -14,9 +14,14 @@ public class InventoryHorseChest extends InventorySubcontainer { // CraftBukkit start public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); - public org.bukkit.entity.Player player; + private EntityHorse horse; private int maxStack = MAX_STACK; + public InventoryHorseChest(String s, int i, EntityHorse horse) { + this(s, i); + this.horse = horse; + } + @Override public ItemStack[] getContents() { return this.items; @@ -39,7 +44,7 @@ public class InventoryHorseChest extends InventorySubcontainer { @Override public org.bukkit.inventory.InventoryHolder getOwner() { - return this.player; + return (org.bukkit.entity.Horse) this.horse.getBukkitEntity(); } @Override |