mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
From 3186ae96aa6c7d86c23f409de90bdcd99030f179 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] Add API for Villager#resetOffers()
|
|
|
|
---
|
|
.../java/net/minecraft/server/EntityVillagerAbstract.java | 8 ++++++++
|
|
.../java/org/bukkit/craftbukkit/entity/CraftVillager.java | 7 +++++++
|
|
2 files changed, 15 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
index 4635285320..5fbd13512f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
@@ -84,6 +84,13 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
|
return this.tradingPlayer != null;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public void resetOffers() {
|
|
+ this.trades = new MerchantRecipeList();
|
|
+ this.updateTrades();
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public MerchantRecipeList getOffers() {
|
|
if (this.trades == null) {
|
|
@@ -225,6 +232,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
|
return this.world;
|
|
}
|
|
|
|
+ protected void updateTrades() { eC(); } // Purpur
|
|
protected abstract void eC();
|
|
|
|
protected void a(MerchantRecipeList merchantrecipelist, VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption, int i) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
index 19409c7a25..d9e19648ff 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
@@ -164,4 +164,11 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
|
}
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void resetOffers() {
|
|
+ getHandle().resetOffers();
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
--
|
|
2.24.0
|
|
|