Prevent certain quests throwing error when taken, fixes #530

This commit is contained in:
BuildTools 2018-11-20 20:37:16 -05:00
parent f2fc09d0bc
commit 83ef4e849e

View File

@ -430,18 +430,18 @@ public class Quester {
Material m = Material.matchMaterial(serial); Material m = Material.matchMaterial(serial);
Enchantment e = Enchantment.getByName(Lang.getKey(enchant).replace("ENCHANTMENT_", "")); Enchantment e = Enchantment.getByName(Lang.getKey(enchant).replace("ENCHANTMENT_", ""));
plugin.query.sendMessage(player, s.replace(serial, "<item>").replace(enchant, "<enchantment>"), m, e); plugin.query.sendMessage(player, s.replace(serial, "<item>").replace(enchant, "<enchantment>"), m, e);
continue;
} else if (Material.matchMaterial(serial) != null) { } else if (Material.matchMaterial(serial) != null) {
Material m = Material.matchMaterial(serial); Material m = Material.matchMaterial(serial);
plugin.query.sendMessage(player, s.replace(serial, "<item>"), m); plugin.query.sendMessage(player, s.replace(serial, "<item>"), m);
} else if (EntityType.valueOf(serial.toUpperCase().replace(" ", "_")) != null) { continue;
} else {
try { try {
EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_")); EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_"));
plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type); plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
player.sendMessage(s); player.sendMessage(s);
} }
} else {
player.sendMessage(s);
} }
} catch (IndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
player.sendMessage(s); player.sendMessage(s);