Skip to content

Commit

Permalink
[#660] Fixed blank nbt when using some inventory manager functions
Browse files Browse the repository at this point in the history
Signed-off-by: Srendi <info@denizdemiroglu.de>
  • Loading branch information
SirEndii authored Sep 30, 2024
1 parent 8222f8d commit 833e5df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ public final int getFreeSlot() throws LuaException {

@LuaFunction(mainThread = true)
public final Map<String, Object> getItemInHand() throws LuaException {
return LuaConverter.stackToObject(getOwnerPlayer().getMainHandItem());
return LuaConverter.stackToObject(getOwnerPlayer().getMainHandItem().copy());
}

@LuaFunction(mainThread = true)
public final Map<String, Object> getItemInOffHand() throws LuaException {
return LuaConverter.stackToObject(getOwnerPlayer().getOffhandItem());
return LuaConverter.stackToObject(getOwnerPlayer().getOffhandItem().copy());
}

private Player getOwnerPlayer() throws LuaException {
Expand Down

0 comments on commit 833e5df

Please sign in to comment.