aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0369-Fix-villager-trading-demand-MC-163962.patch
diff options
context:
space:
mode:
authorRiley Park <[email protected]>2024-05-15 17:06:59 -0700
committerGitHub <[email protected]>2024-05-15 17:06:59 -0700
commitf17519338bc589c045e0b32bfc37e048b23544d5 (patch)
treee50182ec698b4a9de8f366f485ee089b1901bbd9 /patches/server/0369-Fix-villager-trading-demand-MC-163962.patch
parent3fc93581bb876e8149b2ca423375a98f5ca12d27 (diff)
downloadPaper-f17519338bc589c045e0b32bfc37e048b23544d5.tar.gz
Paper-f17519338bc589c045e0b32bfc37e048b23544d5.zip
Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: masmc05 <[email protected]>
Diffstat (limited to 'patches/server/0369-Fix-villager-trading-demand-MC-163962.patch')
-rw-r--r--patches/server/0369-Fix-villager-trading-demand-MC-163962.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0369-Fix-villager-trading-demand-MC-163962.patch b/patches/server/0369-Fix-villager-trading-demand-MC-163962.patch
new file mode 100644
index 0000000000..bd7b6c4273
--- /dev/null
+++ b/patches/server/0369-Fix-villager-trading-demand-MC-163962.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: chickeneer <[email protected]>
+Date: Fri, 5 Jun 2020 20:02:04 -0500
+Subject: [PATCH] Fix villager trading demand - MC-163962
+
+Prevent demand from going negative and tending to negative infinity
+
+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 44808589939afe50d8294269b7da12019acd2690..89982d25f60c8b60ba91e559ef88278f338fe215 100644
+--- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
++++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
+@@ -124,7 +124,7 @@ public class MerchantOffer {
+ }
+
+ public void updateDemand() {
+- this.demand = this.demand + this.uses - (this.maxUses - this.uses);
++ this.demand = Math.max(0, this.demand + this.uses - (this.maxUses - this.uses)); // Paper - Fix MC-163962
+ }
+
+ public ItemStack assemble() {