Paper/patches/server/0724-Fix-MerchantOffer-BuyB-Only-AssertionError.patch
Shane Freeder aa52bf9e33
Remove "Implement-Chunk-Priority-Urgency-System-for-Chunks" (Fixes #5980)
Mojang made some changes to priorities in 1.17 and it seems that these changes
conflict with the changes made in this patch, which in some cases appears to
cause excessive rescheduling of tasks.

This, however, is not confirmed as such but seems to be the behavior that we're
seeing to cause this issue, if mojang has adopted the changes we suggested,
then a good chunk of this patch may be unneeded, but, this needs a much better
look than I'm currently able to do
2021-08-14 14:55:55 +01:00

19 lines
1017 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: thamid-gamer <60953955+thamid-gamer@users.noreply.github.com>
Date: Fri, 16 Jul 2021 16:00:17 -0400
Subject: [PATCH] Fix MerchantOffer BuyB-Only AssertionError
diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
index 70b703b920752e7301e4f19cdc07a1a4ceac5e0e..33660209885a9d56b127ca3926b6c7c60469127e 100644
--- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
+++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
@@ -231,6 +231,7 @@ public class MerchantOffer {
if (!this.satisfiedBy(firstBuyStack, secondBuyStack)) {
return false;
} else {
+ if (!this.getCostA().isEmpty()) // Paper
firstBuyStack.shrink(this.getCostA().getCount());
if (!this.getCostB().isEmpty()) {
secondBuyStack.shrink(this.getCostB().getCount());