From c96e81189ea193f7e4dfeb39951a4ff81bb23bd8 Mon Sep 17 00:00:00 2001 From: De6ris <115866772+De6ris@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:23:45 +0800 Subject: [PATCH 1/4] Update BundleHelper.java Fix item duplication while crafting --- src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java index 6237718..8900ca6 100644 --- a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java +++ b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java @@ -61,6 +61,9 @@ private static ItemStack bundleItem(PlayerEntity player, ItemStack hostStack, It if (amount == 0) return null; transaction.commit(); insertStack.decrement((int) amount); + if (player.currentScreenHandler instanceof CraftingScreenHandler) { + player.currentScreenHandler.onContentChanged(null); + } bundlingInv.onClose(player); return insertStack; } From e15c398de1d427c2b29f61bb0edb771d0e389ab5 Mon Sep 17 00:00:00 2001 From: De6ris <115866772+De6ris@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:25:26 +0800 Subject: [PATCH 2/4] Update BundleHelper.java In the previous commit I forgot updating importing --- src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java index 8900ca6..0ec6b2f 100644 --- a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java +++ b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java @@ -10,6 +10,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; +import net.minecraft.screen.CraftingScreenHandler; import net.minecraft.screen.slot.Slot; import net.minecraft.util.ClickType; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; From aa095aa9f5bd7d3c0fe6c32d2b664bf96d6d0525 Mon Sep 17 00:00:00 2001 From: De6ris <115866772+De6ris@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:57:59 +0800 Subject: [PATCH 3/4] Update BundleHelper.java I forgot the 2x2 crafting in player screen --- src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java index 0ec6b2f..fc8735b 100644 --- a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java +++ b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java @@ -62,7 +62,7 @@ private static ItemStack bundleItem(PlayerEntity player, ItemStack hostStack, It if (amount == 0) return null; transaction.commit(); insertStack.decrement((int) amount); - if (player.currentScreenHandler instanceof CraftingScreenHandler) { + if (player.currentScreenHandler instanceof CraftingScreenHandler || player.currentScreenHandler instanceof PlayerScreenHandler) { player.currentScreenHandler.onContentChanged(null); } bundlingInv.onClose(player); From 1db692b10b5093f59f8bd5317fa47fac76b9b8f8 Mon Sep 17 00:00:00 2001 From: De6ris <115866772+De6ris@users.noreply.github.com> Date: Sun, 10 Mar 2024 00:59:39 +0800 Subject: [PATCH 4/4] Update BundleHelper.java Again I forgot updating import(because I'm just editing in github page, not pushing from local) --- src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java index fc8735b..6c60d27 100644 --- a/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java +++ b/src/main/java/net/kyrptonaught/quickshulker/BundleHelper.java @@ -11,6 +11,7 @@ import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.screen.CraftingScreenHandler; +import net.minecraft.screen.PlayerScreenHandler; import net.minecraft.screen.slot.Slot; import net.minecraft.util.ClickType; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;