From 2ee7427806b6573cfe05ca8a6c4d4159ffc14332 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 3 Sep 2020 08:18:30 +1000 Subject: [PATCH] #744: Add ability to get location from smithing inventory By: Phoenix616 --- paper-server/nms-patches/ContainerSmithing.patch | 2 +- .../craftbukkit/inventory/CraftInventorySmithing.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/paper-server/nms-patches/ContainerSmithing.patch b/paper-server/nms-patches/ContainerSmithing.patch index 168390f113..d9dd6db03f 100644 --- a/paper-server/nms-patches/ContainerSmithing.patch +++ b/paper-server/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/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java index 66193df7e0..d577c1754c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventorySmithing.java +++ b/paper-server/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; } }