diff options
author | Jake Potrebic <[email protected]> | 2024-04-27 15:50:33 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-27 15:50:38 -0700 |
commit | d02bb811de6f9d7e42001137b93d6a6f88359ab6 (patch) | |
tree | a396cbb1f0ada45b98703f8125f06f17334dc080 /patches/server/0432-Villager-resetOffers.patch | |
parent | dd571d89f2202bda719a40fd15f92cc754b6ade1 (diff) | |
download | Paper-d02bb811de6f9d7e42001137b93d6a6f88359ab6.tar.gz Paper-d02bb811de6f9d7e42001137b93d6a6f88359ab6.zip |
proper migration to gamerules for keep spawn loaded distance
Diffstat (limited to 'patches/server/0432-Villager-resetOffers.patch')
-rw-r--r-- | patches/server/0432-Villager-resetOffers.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0432-Villager-resetOffers.patch b/patches/server/0432-Villager-resetOffers.patch new file mode 100644 index 0000000000..e8e71e6b5c --- /dev/null +++ b/patches/server/0432-Villager-resetOffers.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +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 521c9602db7c532470adcd5f024d3dd0f1e88780..79e81fd5490a493b595dc1034641e13451e5a61a 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +@@ -116,6 +116,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa + return this.tradingPlayer != null; + } + ++ // Paper start - Villager#resetOffers ++ public void resetOffers() { ++ this.offers = new MerchantOffers(); ++ this.updateTrades(); ++ } ++ // Paper end - Villager#resetOffers ++ + @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 +--- 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 - Villager#resetOffers ++ @Override ++ public void resetOffers() { ++ getHandle().resetOffers(); ++ } ++ // Paper end - Villager#resetOffers + } |