mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-02 14:38:06 +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-")) {
|
||||
String[] temp = arg.substring(12).split(" ");
|
||||
try {
|
||||
enchs.put(Quests.getEnchantment(temp[0]), Integer.parseInt(temp[1]));
|
||||
if (Quests.getEnchantment(temp[0]) != null) {
|
||||
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) {
|
||||
Bukkit.getLogger().severe("The enchantment name \'" + temp[0] + "\' is invalid. Make sure quests.yml is UTF-8 encoded");
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user