mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-18 15:18:34 +01:00
Prevent certain quests throwing error when taken, fixes #530
This commit is contained in:
parent
f2fc09d0bc
commit
83ef4e849e
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user