From f1576d698378a30a208f7fcdaa44a7ac8bb55a12 Mon Sep 17 00:00:00 2001 From: NichtStudioCode <51272202+NichtStudioCode@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:26:39 +0200 Subject: [PATCH] Fixed hotbar and offhand item being air instead of null --- InvUI/src/main/java/de/studiocode/invui/gui/impl/BaseGUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvUI/src/main/java/de/studiocode/invui/gui/impl/BaseGUI.java b/InvUI/src/main/java/de/studiocode/invui/gui/impl/BaseGUI.java index 33f5609..611127f 100644 --- a/InvUI/src/main/java/de/studiocode/invui/gui/impl/BaseGUI.java +++ b/InvUI/src/main/java/de/studiocode/invui/gui/impl/BaseGUI.java @@ -246,7 +246,7 @@ public abstract class BaseGUI implements GUI { Inventory playerInventory = player.getInventory(); int hotbarButton = event.getHotbarButton(); ItemStack hotbarItem = playerInventory.getItem(hotbarButton); - if (hotbarItem != null) hotbarItem = hotbarItem.clone(); + if (hotbarItem != null && hotbarItem.getType().isAir()) hotbarItem = null; UpdateReason updateReason = new PlayerUpdateReason(player, event); @@ -261,6 +261,7 @@ public abstract class BaseGUI implements GUI { if (window instanceof SingleWindow) { PlayerInventory playerInventory = player.getInventory(); ItemStack offhandItem = playerInventory.getItemInOffHand(); + if (offhandItem != null && offhandItem.getType().isAir()) offhandItem = null; UpdateReason updateReason = new PlayerUpdateReason(player, event);