Added a check when using an upgradeable to check if the template exists.

This commit is contained in:
ASangarin 2020-07-24 18:50:18 +02:00
parent a241949c55
commit 5719442144

View File

@ -72,6 +72,11 @@ public class UpgradeData implements StatData, RandomStatData {
}
public void upgrade(MMOItem mmoitem) {
if(!MMOItems.plugin.getUpgrades().hasTemplate(template)) {
MMOItems.plugin.getLogger().warning("Couldn't find upgrade template '" + template + "'. Does it exist?");
return;
}
// change display name
String suffix = new ColorParse('&', MMOItems.plugin.getConfig().getString("item-upgrading.name-suffix")).toChatColor();
if (MMOItems.plugin.getConfig().getBoolean("item-upgrading.display-in-name"))