9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-27 10:59:16 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0074-Fix-MC-65198.patch
Dreeam 01fa6ac227 Add Leaf Commands (WIP)
* Added Leaf Commands base
* Added WIP /leaf reload
* Added /leaf version
* Change /gale permission to OP as default
2025-02-22 03:15:42 -05:00

63 lines
3.2 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-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 01b8d73b1be9b41d6f51d11a0bead37a7bd9023f..7637eed0dedcdc5ac0dd51cc82010eb4bbf5b784 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.level(), this.player, this.removeCount);
+ stack.onCraftedBy(this.player.level(), 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 d6854d0ebe5cb4205963e879d71eb3940d54de1f..72dbf8c03fcd5210fb2764f5c0a2a3ce3b1f9b51 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.level(), 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);
}