9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0164-Fix-MC-65198.patch
2025-06-28 10:37:38 +08:00

63 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <fsjk947@gmail.com>
Date: Wed, 13 Mar 2024 03:33:08 +0800
Subject: [PATCH] Fix MC-65198
Mojang issues: https://bugs.mojang.com/browse/MC/issues/MC-65198
diff --git a/net/minecraft/world/inventory/ItemCombinerMenu.java b/net/minecraft/world/inventory/ItemCombinerMenu.java
index c605bd700fd9f5a6596a2bf9648492786306b025..77c0b0b6c63d0a2955fcf3a479581f09067f3e62 100644
--- a/net/minecraft/world/inventory/ItemCombinerMenu.java
+++ b/net/minecraft/world/inventory/ItemCombinerMenu.java
@@ -120,6 +120,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
if (slot != null && slot.hasItem()) {
ItemStack item = slot.getItem();
itemStack = item.copy();
+ ItemStack itemStack2 = itemStack.copy(); // Leaf - Fix MC-65198
int inventorySlotStart = this.getInventorySlotStart();
int useRowEnd = this.getUseRowEnd();
if (index == this.getResultSlot()) {
@@ -157,7 +158,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
}
this.activeQuickItem = itemStack; // Purpur - Anvil API
- slot.onTake(player, item);
+ slot.onTake(player, itemStack2); // Leaf - Fix MC-65198
this.activeQuickItem = null; // Purpur - Anvil API
}
diff --git a/net/minecraft/world/inventory/ResultSlot.java b/net/minecraft/world/inventory/ResultSlot.java
index e4cba45c327d96550a92cd5f9a30b1e5bd212747..ba237017e21d66b4eb3b47b4c7160015993da348 100644
--- a/net/minecraft/world/inventory/ResultSlot.java
+++ b/net/minecraft/world/inventory/ResultSlot.java
@@ -49,7 +49,7 @@ public class ResultSlot extends Slot {
@Override
protected void checkTakeAchievements(ItemStack stack) {
if (this.removeCount > 0) {
- stack.onCraftedBy(this.player, this.removeCount);
+ stack.onCraftedBy(this.player, stack.getCount()); // Leaf - Fix MC-65198
}
if (this.container instanceof RecipeCraftingHolder recipeCraftingHolder) {
diff --git a/net/minecraft/world/inventory/StonecutterMenu.java b/net/minecraft/world/inventory/StonecutterMenu.java
index 9b0b213d7550f02ddba2f9f19fa7b0a45437e968..516acc81b12c003df7744cd66f5dd9b95c0485a4 100644
--- a/net/minecraft/world/inventory/StonecutterMenu.java
+++ b/net/minecraft/world/inventory/StonecutterMenu.java
@@ -238,6 +238,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
ItemStack item = slot.getItem();
Item item1 = item.getItem();
itemStack = item.copy();
+ ItemStack itemStack2 = itemStack.copy(); // Leaf - Fix MC-65198
if (index == 1) {
item1.onCraftedBy(item, player);
if (!this.moveItemStackTo(item, 2, 38, true)) {
@@ -270,7 +271,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
return ItemStack.EMPTY;
}
- slot.onTake(player, item);
+ slot.onTake(player, itemStack2); // Leaf - Fix MC-65198
if (index == 1) {
player.drop(item, false);
}