From 95c69f15bea2e2e38a9bf680f2e0bf0b0b356e4e Mon Sep 17 00:00:00 2001 From: chickeneer Date: Sun, 7 Jun 2020 13:41:32 -0500 Subject: [PATCH] Fix villager trading demand MC-163962 (#3498) --- ...ix-villager-trading-demand-MC-163962.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Spigot-Server-Patches/Fix-villager-trading-demand-MC-163962.patch diff --git a/Spigot-Server-Patches/Fix-villager-trading-demand-MC-163962.patch b/Spigot-Server-Patches/Fix-villager-trading-demand-MC-163962.patch new file mode 100644 index 0000000000..d3eeffb66a --- /dev/null +++ b/Spigot-Server-Patches/Fix-villager-trading-demand-MC-163962.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: chickeneer +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/server/MerchantRecipe.java b/src/main/java/net/minecraft/server/MerchantRecipe.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/MerchantRecipe.java ++++ b/src/main/java/net/minecraft/server/MerchantRecipe.java +@@ -0,0 +0,0 @@ public class MerchantRecipe { + } + + public void e() { +- this.demand = this.demand + this.uses - (this.maxUses - this.uses); ++ this.demand = Math.max(0, this.demand + this.uses - (this.maxUses - this.uses)); // Paper + } + + public ItemStack f() {