9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-28 03:09:11 +00:00
Files
DivineMC/patches/server/0049-Fix-MC-65198.patch
NONPLAYT 16f429723b Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@998a4e6 [ci skip] add a good chunk of patch identifying comments
PurpurMC/Purpur@e440784 [ci skip] a couple more patch identifying comments
PurpurMC/Purpur@c33391b Updated Upstream (Paper)
PurpurMC/Purpur@8d7fab1 [ci skip] small patch comment cleanup
2024-12-16 20:56:44 +03:00

66 lines
3.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 15 Dec 2024 23:28:29 +0300
Subject: [PATCH] Fix MC-65198
Original post on Mojira: https://bugs.mojang.com/browse/MC-65198
diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
index ac9df238ef0f3d009f25976b95e0b750e963e952..9b187768d645759f12d1a474fe488663d304a068 100644
--- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
@@ -129,6 +129,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
ItemStack itemstack1 = slot1.getItem();
itemstack = itemstack1.copy();
+ ItemStack itemStack2 = itemstack.copy(); // DivineMC - Fix MC-65198
int j = this.getInventorySlotStart();
int k = this.getUseRowEnd();
@@ -165,7 +166,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
}
this.activeQuickItem = itemstack; // Purpur - Anvil API
- slot1.onTake(player, itemstack1);
+ slot1.onTake(player, itemStack2); // DivineMC - Fix MC-65198
this.activeQuickItem = null; // Purpur - Anvil API
}
diff --git a/src/main/java/net/minecraft/world/inventory/ResultSlot.java b/src/main/java/net/minecraft/world/inventory/ResultSlot.java
index ff30071f3ef37d1b28cf86e26ce4f7477335a07a..a7b2a88cf2c1e8f717e512a9bc01772a463009bb 100644
--- a/src/main/java/net/minecraft/world/inventory/ResultSlot.java
+++ b/src/main/java/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()); // DivineMC - Fix MC-65198
}
if (this.container instanceof RecipeCraftingHolder recipeCraftingHolder) {
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
index 5dce62aead43c7110e06196423458eea2ba31885..120094e07b73e81dbaa5bb1cf727feb3842f7380 100644
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
@@ -259,6 +259,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
Item item = itemstack1.getItem();
itemstack = itemstack1.copy();
+ ItemStack itemStack2 = itemstack.copy(); // DivineMC - Fix MC-65198
if (slot == 1) {
item.onCraftedBy(itemstack1, player.level(), player);
if (!this.moveItemStackTo(itemstack1, 2, 38, true)) {
@@ -291,9 +292,9 @@ public class StonecutterMenu extends AbstractContainerMenu {
return ItemStack.EMPTY;
}
- slot1.onTake(player, itemstack1);
+ slot1.onTake(player, itemStack2); // DivineMC - Fix MC-65198
if (slot == 1) {
- player.drop(itemstack1, false);
+ player.drop(itemStack2, false); // DivineMC - Fix MC-65198
}
this.broadcastChanges();