Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
SPIGOT-5037: Player.openMerchant does not show merchant level
Dieser Commit ist enthalten in:
Ursprung
123117bd3a
Commit
7cc7719ffd
@ -596,9 +596,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
|
|
||||||
IMerchant mcMerchant;
|
IMerchant mcMerchant;
|
||||||
IChatBaseComponent name;
|
IChatBaseComponent name;
|
||||||
|
int level = 0;
|
||||||
if (merchant instanceof CraftVillager) {
|
if (merchant instanceof CraftVillager) {
|
||||||
mcMerchant = ((CraftVillager) merchant).getHandle();
|
mcMerchant = ((CraftVillager) merchant).getHandle();
|
||||||
name = ((CraftVillager) merchant).getHandle().getScoreboardDisplayName();
|
name = ((CraftVillager) merchant).getHandle().getScoreboardDisplayName();
|
||||||
|
level = ((CraftVillager) merchant).getHandle().getVillagerData().getLevel();
|
||||||
} else if (merchant instanceof CraftMerchantCustom) {
|
} else if (merchant instanceof CraftMerchantCustom) {
|
||||||
mcMerchant = ((CraftMerchantCustom) merchant).getMerchant();
|
mcMerchant = ((CraftMerchantCustom) merchant).getMerchant();
|
||||||
name = ((CraftMerchantCustom) merchant).getMerchant().getScoreboardDisplayName();
|
name = ((CraftMerchantCustom) merchant).getMerchant().getScoreboardDisplayName();
|
||||||
@ -607,7 +609,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mcMerchant.setTradingPlayer(this.getHandle());
|
mcMerchant.setTradingPlayer(this.getHandle());
|
||||||
mcMerchant.openTrade(this.getHandle(), name, 0);
|
mcMerchant.openTrade(this.getHandle(), name, level);
|
||||||
|
|
||||||
return this.getHandle().activeContainer.getBukkitView();
|
return this.getHandle().activeContainer.getBukkitView();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren