From 13fc33f73249ee2bd8edd5ac3657be65383bdf60 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 3 Sep 2020 08:18:30 +1000 Subject: [PATCH] #744: Add ability to get location from smithing inventory --- nms-patches/ContainerSmithing.patch | 2 +- .../craftbukkit/inventory/CraftInventorySmithing.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/nms-patches/ContainerSmithing.patch b/nms-patches/ContainerSmithing.patch index 168390f113..d9dd6db03f 100644 --- a/nms-patches/ContainerSmithing.patch +++ b/nms-patches/ContainerSmithing.patch @@ -47,7 +47,7 @@ + } + + org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventorySmithing( -+ this.repairInventory, this.resultInventory); ++ containerAccess.getLocation(), this.repairInventory, this.resultInventory); + bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this); + return bukkitEntity; + } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java index 66193df7e0..d577c1754c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java @@ -1,11 +1,20 @@ package org.bukkit.craftbukkit.inventory; import net.minecraft.server.IInventory; +import org.bukkit.Location; import org.bukkit.inventory.SmithingInventory; public class CraftInventorySmithing extends CraftResultInventory implements SmithingInventory { - public CraftInventorySmithing(IInventory inventory, IInventory resultInventory) { + private final Location location; + + public CraftInventorySmithing(Location location, IInventory inventory, IInventory resultInventory) { super(inventory, resultInventory); + this.location = location; + } + + @Override + public Location getLocation() { + return location; } }