SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants

Dieser Commit ist enthalten in:
blablubbabc 2019-06-21 05:06:16 +02:00 committet von md_5
Ursprung 9af900778d
Commit 6dde4b9fda
2 geänderte Dateien mit 8 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -596,11 +596,13 @@ 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();
int level = 1; // note: using level 0 with active 'is-regular-villager'-flag allows hiding the name suffix
if (merchant instanceof CraftAbstractVillager) {
mcMerchant = ((CraftAbstractVillager) merchant).getHandle();
name = ((CraftAbstractVillager) merchant).getHandle().getScoreboardDisplayName();
if (merchant instanceof CraftVillager) {
level = ((CraftVillager) merchant).getHandle().getVillagerData().getLevel();
}
} else if (merchant instanceof CraftMerchantCustom) {
mcMerchant = ((CraftMerchantCustom) merchant).getMerchant();
name = ((CraftMerchantCustom) merchant).getMerchant().getScoreboardDisplayName();

Datei anzeigen

@ -95,7 +95,7 @@ public class CraftMerchantCustom extends CraftMerchant {
@Override
public boolean eb() {
return true;
return false; // is-regular-villager flag (hides some gui elements: xp bar, name suffix)
}
@Override