PaperMC/patches/server/0429-Villager-resetOffers.patch

41 lines
1.8 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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
2024-04-24 15:46:45 +02:00
index 521c9602db7c532470adcd5f024d3dd0f1e88780..79e81fd5490a493b595dc1034641e13451e5a61a 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
2024-04-24 15:46:45 +02:00
@@ -116,6 +116,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
2021-06-11 14:02:28 +02:00
return this.tradingPlayer != null;
}
+ // Paper start - Villager#resetOffers
2021-06-11 14:02:28 +02:00
+ public void resetOffers() {
+ this.offers = new MerchantOffers();
+ this.updateTrades();
+ }
+ // Paper end - Villager#resetOffers
2021-06-11 14:02:28 +02:00
+
@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 19833c1fc6ee85e031e3c6aac3b00f44730c5e02..34e4c763c7ec971885147ab2509281fad56e1ca6 100644
2021-06-11 14:02:28 +02:00
--- 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() {
2021-06-14 18:58:00 +02:00
return this.getMerchant().getTrader();
2021-06-11 14:02:28 +02:00
}
+
+ // Paper start - Villager#resetOffers
2021-06-11 14:02:28 +02:00
+ @Override
+ public void resetOffers() {
+ getHandle().resetOffers();
+ }
+ // Paper end - Villager#resetOffers
2021-06-11 14:02:28 +02:00
}