3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Fix villager trading demand MC-163962 (#3498)

Dieser Commit ist enthalten in:
chickeneer 2020-06-07 13:41:32 -05:00 committet von GitHub
Ursprung 51f9edf22d
Commit e7cf34a039
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -0,0 +1,20 @@
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/server/MerchantRecipe.java b/src/main/java/net/minecraft/server/MerchantRecipe.java
index f1f49c2ebff93ce3537bd4a58916d4c624a3fe82..7c4dc1143696320c8b8dc21ea4ae0600d5686d62 100644
--- a/src/main/java/net/minecraft/server/MerchantRecipe.java
+++ b/src/main/java/net/minecraft/server/MerchantRecipe.java
@@ -104,7 +104,7 @@ 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() {