From b79bc31d3076e1eb775f7b430a4dcfb7c1c071ba Mon Sep 17 00:00:00 2001 From: thamid-gamer <60953955+thamid-gamer@users.noreply.github.com> Date: Mon, 19 Jul 2021 05:16:53 -0400 Subject: [PATCH] Fix MerchantOffer BuyB Only AssertionError (#6206) --- ...erchantOffer-BuyB-Only-AssertionError.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/server/0728-Fix-MerchantOffer-BuyB-Only-AssertionError.patch diff --git a/patches/server/0728-Fix-MerchantOffer-BuyB-Only-AssertionError.patch b/patches/server/0728-Fix-MerchantOffer-BuyB-Only-AssertionError.patch new file mode 100644 index 0000000000..19bb554a65 --- /dev/null +++ b/patches/server/0728-Fix-MerchantOffer-BuyB-Only-AssertionError.patch @@ -0,0 +1,18 @@ +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());