mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-06 16:37:39 +01:00
Check that enchantment names are spelled correctly, fixes #566
This commit is contained in:
parent
039ed174fb
commit
7d72d9129c
@ -168,7 +168,11 @@ public class ItemUtil {
|
|||||||
} else if (arg.startsWith("enchantment-")) {
|
} else if (arg.startsWith("enchantment-")) {
|
||||||
String[] temp = arg.substring(12).split(" ");
|
String[] temp = arg.substring(12).split(" ");
|
||||||
try {
|
try {
|
||||||
|
if (Quests.getEnchantment(temp[0]) != null) {
|
||||||
enchs.put(Quests.getEnchantment(temp[0]), Integer.parseInt(temp[1]));
|
enchs.put(Quests.getEnchantment(temp[0]), Integer.parseInt(temp[1]));
|
||||||
|
} else {
|
||||||
|
Bukkit.getLogger().severe("The enchantment name \'" + temp[0] + "\' is invalid. Make sure it is spelled correctly");
|
||||||
|
}
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
Bukkit.getLogger().severe("The enchantment name \'" + temp[0] + "\' is invalid. Make sure quests.yml is UTF-8 encoded");
|
Bukkit.getLogger().severe("The enchantment name \'" + temp[0] + "\' is invalid. Make sure quests.yml is UTF-8 encoded");
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user