Ensure valid entity name translation, fixes #503. Bump version number

This commit is contained in:
BuildTools 2018-11-13 00:26:56 -05:00
parent 9e79d8fcb3
commit 3bd394ce12
3 changed files with 8 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId> <artifactId>quests</artifactId>
<version>3.4.0</version> <version>3.4.1</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url> <url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@ -39,7 +39,7 @@ public class ObjectiveTimer extends BukkitRunnable {
quest.failQuest(quester); quest.failQuest(quester);
quester.updateJournal(); quester.updateJournal();
} else { } else {
quester.getPlayer().sendMessage(Lang.get(quester.getPlayer(), "timerMessage").replaceAll("<time>", String.valueOf(time))); quester.getPlayer().sendMessage(Lang.get(quester.getPlayer(), "timerMessage").replace("<time>", String.valueOf(time)));
} }
} }
} }

View File

@ -434,8 +434,12 @@ public class Quester {
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) { } else if (EntityType.valueOf(serial.toUpperCase().replace(" ", "_")) != null) {
EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_")); try {
plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type); EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_"));
plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type);
} catch (IllegalArgumentException e) {
player.sendMessage(s);
}
} else { } else {
player.sendMessage(s); player.sendMessage(s);
} }