diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java index dd550c1a09..a2eb347311 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 9fff6acf70..400feb56de 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 809f8d408a..374da50265 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 d40ab0737d..0d298e852c 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