mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
48 lines
2.1 KiB
Diff
48 lines
2.1 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
@@ -0,0 +0,0 @@ public abstract class AbstractVillager extends AgableMob implements Npc, Merchan
|
|
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) {
|
|
@@ -0,0 +0,0 @@ public abstract class AbstractVillager extends AgableMob implements Npc, Merchan
|
|
return this.level;
|
|
}
|
|
|
|
+ protected final void updateTrades() { updateTrades(); } // Paper - OBFHELPER
|
|
protected abstract void updateTrades();
|
|
|
|
protected void addOffersFromItemListings(MerchantOffers recipeList, VillagerTrades.ItemListing[] pool, int count) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
|
@@ -0,0 +0,0 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
|
|
public HumanEntity getTrader() {
|
|
return getMerchant().getTrader();
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public void resetOffers() {
|
|
+ getHandle().resetOffers();
|
|
+ }
|
|
+ // Paper end
|
|
}
|