2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: chickeneer <emcchickeneer@gmail.com>
|
|
|
|
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
|
2022-06-08 05:02:19 +00:00
|
|
|
index 987e65332058f364fcef0a29c97b206b14ad6457..8b46e494ecd0cce5ab0b2bf8e50cf50dc7e2a7e5 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
|
2021-12-20 22:46:51 +00:00
|
|
|
@@ -113,7 +113,7 @@ public class MerchantOffer {
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack assemble() {
|