From 16498424a8ee3685987264ba3f9c25b73eb418ff Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 30 Jul 2018 17:52:32 +0200 Subject: [PATCH] Fix some NPEs for localizations --- .../de/epiceric/shopchest/language/LanguageUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java index 2164395..0ca7e6a 100644 --- a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java @@ -2218,7 +2218,7 @@ public class LanguageUtils { } } - return itemName.getLocalizedName() + " " + formatDefaultString(spawnedType.toString()); + return itemName.getLocalizedName() + " " + formatDefaultString(String.valueOf(spawnedType)); } if (itemName.getSubId() == stack.getDurability()) { @@ -2229,7 +2229,7 @@ public class LanguageUtils { } } - return formatDefaultString(material.toString()); + return formatDefaultString(String.valueOf(material)); } /** @@ -2303,7 +2303,7 @@ public class LanguageUtils { upgraded = potionMeta.getBasePotionData().isUpgraded(); } - String potionEffectString = formatDefaultString(potionEffect.toString()); + String potionEffectString = formatDefaultString(String.valueOf(potionEffect)); for (PotionEffectName potionEffectName : potionEffectNames) { if (potionEffectName.getEffect() == potionEffect) { @@ -2357,7 +2357,7 @@ public class LanguageUtils { } } - return formatDefaultString(generation.toString()); + return formatDefaultString(String.valueOf(generation)); } /**