mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
49 lines
1.9 KiB
Diff
49 lines
1.9 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/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
index 68fd780bc..ced893452 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
@@ -85,6 +85,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) {
|
|
@@ -207,6 +214,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
|
return this.world;
|
|
}
|
|
|
|
+ protected void updateTrades() { eW(); } // Purpur
|
|
protected abstract void eW();
|
|
|
|
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 d24a892c4..abfa6340f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
@@ -169,4 +169,11 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
|
getHandle().getReputation().getReputations().clear();
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void resetOffers() {
|
|
+ getHandle().resetOffers();
|
|
+ }
|
|
+ // Purpur end
|
|
}
|