From 833e5df3a9fc7d20ab2f58c7eb2526f183e6a67f Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 30 Sep 2024 21:48:33 +0200 Subject: [PATCH] [#660] Fixed blank nbt when using some inventory manager functions Signed-off-by: Srendi --- .../computercraft/peripheral/InventoryManagerPeripheral.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java index 73e9213a6..a8d01bae8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java @@ -189,12 +189,12 @@ public final int getFreeSlot() throws LuaException { @LuaFunction(mainThread = true) public final Map getItemInHand() throws LuaException { - return LuaConverter.stackToObject(getOwnerPlayer().getMainHandItem()); + return LuaConverter.stackToObject(getOwnerPlayer().getMainHandItem().copy()); } @LuaFunction(mainThread = true) public final Map getItemInOffHand() throws LuaException { - return LuaConverter.stackToObject(getOwnerPlayer().getOffhandItem()); + return LuaConverter.stackToObject(getOwnerPlayer().getOffhandItem().copy()); } private Player getOwnerPlayer() throws LuaException {