From befc2e3874c5bd0ed23eae26c461613f7d7b5975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ampflower=20=F0=9F=8C=BA?= Date: Fri, 30 Aug 2024 00:59:48 -0700 Subject: [PATCH] Fix bulk-drop entering an endless loop. Fixes #4 --- .../java/tfar/fastbench/mixin/CraftingResultSlotMixin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/tfar/fastbench/mixin/CraftingResultSlotMixin.java b/src/main/java/tfar/fastbench/mixin/CraftingResultSlotMixin.java index 47f043c..52b395c 100644 --- a/src/main/java/tfar/fastbench/mixin/CraftingResultSlotMixin.java +++ b/src/main/java/tfar/fastbench/mixin/CraftingResultSlotMixin.java @@ -67,6 +67,11 @@ public CraftingResultSlotMixin(Container inventory, int index, int x, int y) { @Redirect(method = "remove", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/inventory/Slot;remove(I)Lnet/minecraft/world/item/ItemStack;")) private ItemStack copy(Slot slot, int amount) { + // Prevents mass-drop from looping endlessly. + // This does rely on the server to update the slot again, which is fine. + if (player.level().isClientSide) { + return super.remove(amount); + } return slot.getItem().copy(); }