diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-13 22:50:09 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-20 20:30:54 -0400 |
commit | b9a71db046cc11d4678cc9e5f8a4654658e86cfa (patch) | |
tree | 2b7ad4e8de2d3808dba35115fc3c9698ba756d63 | |
parent | 4bcbe2d235a9e3c6e74ccf3d7b754df336a938fe (diff) | |
download | craftbukkit-b9a71db046cc11d4678cc9e5f8a4654658e86cfa.tar craftbukkit-b9a71db046cc11d4678cc9e5f8a4654658e86cfa.tar.gz craftbukkit-b9a71db046cc11d4678cc9e5f8a4654658e86cfa.tar.lz craftbukkit-b9a71db046cc11d4678cc9e5f8a4654658e86cfa.tar.xz craftbukkit-b9a71db046cc11d4678cc9e5f8a4654658e86cfa.zip |
[Bleeding] Make crafting and enchanting inventories keep track of their owner rather than returning null. Addresses BUKKIT-1209
4 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java index dd550c1a..a2eb3473 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java @@ -50,7 +50,10 @@ public class ContainerEnchantTable extends Container { for (l = 0; l < 9; ++l) { this.a(new Slot(playerinventory, l, 8 + l * 18, 142)); } - player = (Player) playerinventory.player.bukkitEntity; // CraftBukkit + // CraftBukkit start + player = (Player) playerinventory.player.bukkitEntity; + enchantSlots.player = player; + // CraftBukkit end } public void addSlotListener(ICrafting icrafting) { diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java b/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java index 9fff6acf..400feb56 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java @@ -38,7 +38,7 @@ public class ContainerEnchantTableSubcontainer implements IInventory { } public InventoryHolder getOwner() { - return null; // TODO: Enchanting tables don't really have an owner? Maybe they should? + return this.player; } public void setMaxStackSize(int size) { diff --git a/src/main/java/net/minecraft/server/ContainerPlayer.java b/src/main/java/net/minecraft/server/ContainerPlayer.java index 809f8d40..374da502 100644 --- a/src/main/java/net/minecraft/server/ContainerPlayer.java +++ b/src/main/java/net/minecraft/server/ContainerPlayer.java @@ -21,7 +21,7 @@ public class ContainerPlayer extends Container { public ContainerPlayer(PlayerInventory playerinventory, boolean flag) { this.resultInventory = new InventoryCraftResult(); // CraftBukkit - moved to before InventoryCrafting construction - this.craftInventory = new InventoryCrafting(this, 2, 2); + this.craftInventory = new InventoryCrafting(this, 2, 2, playerinventory.player); // CraftBukkit - pass player this.craftInventory.resultInventory = this.resultInventory; // CraftBukkit - let InventoryCrafting know about its result slot this.player = playerinventory; // CraftBukkit - save player this.c = false; diff --git a/src/main/java/net/minecraft/server/ContainerWorkbench.java b/src/main/java/net/minecraft/server/ContainerWorkbench.java index d40ab073..0d298e85 100644 --- a/src/main/java/net/minecraft/server/ContainerWorkbench.java +++ b/src/main/java/net/minecraft/server/ContainerWorkbench.java @@ -21,7 +21,7 @@ public class ContainerWorkbench extends Container { public ContainerWorkbench(PlayerInventory playerinventory, World world, int i, int j, int k) { // CraftBukkit start - switched order of IInventory construction and stored player this.resultInventory = new InventoryCraftResult(); - this.craftInventory = new InventoryCrafting(this, 3, 3); + this.craftInventory = new InventoryCrafting(this, 3, 3, playerinventory.player); // CraftBukkit - pass player this.craftInventory.resultInventory = this.resultInventory; this.player = playerinventory; // CraftBukkit end |