From 7cc7719ffdbc025dc8ee6881823ae7523c23ea7b Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 7 Jun 2019 19:48:12 +1000 Subject: [PATCH] SPIGOT-5037: Player.openMerchant does not show merchant level --- .../java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 772f919b6c..93c8441f48 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -596,9 +596,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { IMerchant mcMerchant; IChatBaseComponent name; + int level = 0; if (merchant instanceof CraftVillager) { mcMerchant = ((CraftVillager) merchant).getHandle(); name = ((CraftVillager) merchant).getHandle().getScoreboardDisplayName(); + level = ((CraftVillager) merchant).getHandle().getVillagerData().getLevel(); } else if (merchant instanceof CraftMerchantCustom) { mcMerchant = ((CraftMerchantCustom) merchant).getMerchant(); name = ((CraftMerchantCustom) merchant).getMerchant().getScoreboardDisplayName(); @@ -607,7 +609,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } mcMerchant.setTradingPlayer(this.getHandle()); - mcMerchant.openTrade(this.getHandle(), name, 0); + mcMerchant.openTrade(this.getHandle(), name, level); return this.getHandle().activeContainer.getBukkitView(); }