aa52bf9e33
Mojang made some changes to priorities in 1.17 and it seems that these changes conflict with the changes made in this patch, which in some cases appears to cause excessive rescheduling of tasks. This, however, is not confirmed as such but seems to be the behavior that we're seeing to cause this issue, if mojang has adopted the changes we suggested, then a good chunk of this patch may be unneeded, but, this needs a much better look than I'm currently able to do
41 Zeilen
1.7 KiB
Diff
41 Zeilen
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Mon, 7 Oct 2019 00:15:37 -0500
|
|
Subject: [PATCH] Villager#resetOffers
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
index ab701d86b1181e30d74e0e03eef79c43f7fb2513..2610d9cd849aa38cc7a67aef21223707e85682ec 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
@@ -115,6 +115,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
|
return this.tradingPlayer != null;
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public void resetOffers() {
|
|
+ this.offers = new MerchantOffers();
|
|
+ this.updateTrades();
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
@Override
|
|
public MerchantOffers getOffers() {
|
|
if (this.offers == null) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
index 1467232779541a9e38420caabf273662f380794c..762354681315e4c74e414bf7d677b5422385161e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
@@ -70,4 +70,11 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
|
|
public HumanEntity getTrader() {
|
|
return this.getMerchant().getTrader();
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public void resetOffers() {
|
|
+ getHandle().resetOffers();
|
|
+ }
|
|
+ // Paper end
|
|
}
|