From 479ec05e3b15937ae7e988d9050d167fc6ba307d Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 27 Aug 2018 07:00:56 +1000 Subject: [PATCH] SPIGOT-4310: Reset villager career level with trades --- nms-patches/EntityVillager.patch | 9 +++++++++ .../org/bukkit/craftbukkit/entity/CraftVillager.java | 1 + 2 files changed, 10 insertions(+) diff --git a/nms-patches/EntityVillager.patch b/nms-patches/EntityVillager.patch index 6cfcdfc52c..140034fc1d 100644 --- a/nms-patches/EntityVillager.patch +++ b/nms-patches/EntityVillager.patch @@ -15,6 +15,15 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { +@@ -26,7 +34,7 @@ + public int riches; + private String bO; + public int careerId; +- private int bQ; ++ public int bQ; // PAIL private->public + private boolean bR; + private boolean bS; + public final InventorySubcontainer inventory; @@ -38,7 +46,7 @@ public EntityVillager(World world, 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 a6ee01ca62..e92225808c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -70,6 +70,7 @@ public class CraftVillager extends CraftAgeable implements Villager, InventoryHo if (resetTrades) { getHandle().trades = null; + getHandle().bQ = 0; // SPIGOT-4310 getHandle().populateTrades(); } }