From 76cc488402e116e617071ea5c28902b897e6c9b3 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 12 Mar 2012 16:47:43 -0400 Subject: [PATCH] [Bleeding] DoubleChestInventory.getHolder() no longer returns null. Addresses BUKKIT-995 --- src/main/java/net/minecraft/server/InventoryLargeChest.java | 2 +- .../craftbukkit/inventory/CraftInventoryDoubleChest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/InventoryLargeChest.java b/src/main/java/net/minecraft/server/InventoryLargeChest.java index f59550f889..159740c661 100644 --- a/src/main/java/net/minecraft/server/InventoryLargeChest.java +++ b/src/main/java/net/minecraft/server/InventoryLargeChest.java @@ -43,7 +43,7 @@ public class InventoryLargeChest implements IInventory { } public InventoryHolder getOwner() { - return null; // Double chests technically have multiple owners, so there's no sensible way to pick one + return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here } // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java index 19ae6682d3..a10bd76403 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.inventory; +import org.bukkit.block.DoubleChest; import org.bukkit.inventory.DoubleChestInventory; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -50,4 +51,9 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC right.setContents(rightItems); } } + + @Override + public DoubleChest getHolder() { + return new DoubleChest(this); + } }