Skip to content

Commit

Permalink
Fix bulk-drop entering an endless loop.
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
Ampflower committed Aug 30, 2024
1 parent 7444138 commit befc2e3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit befc2e3

Please sign in to comment.