Skip item if values are missing

This commit is contained in:
GeorgH93 2020-03-21 15:58:04 +01:00
parent 1ce63cb8c3
commit 3948502b8c
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -60,11 +60,11 @@ private void loadItemConfigs()
lore.forEach(loreEntry -> loreFinal.add(ChatColor.translateAlternateColorCodes('&', loreEntry)));
}
final String displayName = ChatColor.translateAlternateColorCodes('&', getConfigE().getString(key + ".DisplayName", "&eBackpack"));
final String material = getYamlE().getString(key + ".Material", "player_head");
final int model = getYamlE().getInt(key + ".Model", 1);
final String material = getYamlE().getString(key + ".Material");
final int model = getYamlE().getInt(key + ".Model");
if(material.equalsIgnoreCase("player_head"))
{
itemConfigs.put(key, new ItemConfigHead(displayName, getConfigE().getString(key + ".HeadValue", ""), model, loreFinal));
itemConfigs.put(key, new ItemConfigHead(displayName, getConfigE().getString(key + ".HeadValue"), model, loreFinal));
}
else
{