placeholders now return null if the PlayerData isn't loaded.

This commit is contained in:
Ethan 2021-11-27 13:16:10 -05:00
parent 4fdd4d18c9
commit 511662cbc6

View File

@ -44,8 +44,10 @@ public class RPGPlaceholders extends PlaceholderExpansion {
@SuppressWarnings("DuplicateExpressions")
@Override
public String onRequest(OfflinePlayer player, String identifier) {
PlayerData playerData = PlayerData.get(player);
if (!PlayerData.has(player.getUniqueId()))
return null;
PlayerData playerData = PlayerData.get(player);
if (identifier.equals("mana_icon"))
return playerData.getProfess().getManaDisplay().getIcon();
if (identifier.equals("mana_name"))