mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +00:00
Fix baltop something having a null name for offline players
This commit is contained in:
parent
36a070be4c
commit
555a62c582
1 changed files with 9 additions and 2 deletions
|
@ -39,8 +39,15 @@ public class BalanceTopImpl implements BalanceTop {
|
||||||
final BigDecimal userMoney = user.getMoney();
|
final BigDecimal userMoney = user.getMoney();
|
||||||
user.updateMoneyCache(userMoney);
|
user.updateMoneyCache(userMoney);
|
||||||
newTotal = newTotal.add(userMoney);
|
newTotal = newTotal.add(userMoney);
|
||||||
final String name = user.isHidden() ? user.getName() : user.getDisplayName();
|
final String name;
|
||||||
entries.add(new BalanceTop.Entry(user.getBase().getUniqueId(), name, userMoney));
|
if (user.getBase() instanceof OfflinePlayer) {
|
||||||
|
name = user.getLastAccountName();
|
||||||
|
} else if (user.isHidden()) {
|
||||||
|
name = user.getName();
|
||||||
|
} else {
|
||||||
|
name = user.getDisplayName();
|
||||||
|
}
|
||||||
|
entries.add(new BalanceTop.Entry(user.getUUID(), name, userMoney));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue