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>
<artifactId>quests</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -39,7 +39,7 @@ public class ObjectiveTimer extends BukkitRunnable {
quest.failQuest(quester);
quester.updateJournal();
} 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);
plugin.query.sendMessage(player, s.replace(serial, "<item>"), m);
} else if (EntityType.valueOf(serial.toUpperCase().replace(" ", "_")) != null) {
EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_"));
plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type);
try {
EntityType type = EntityType.valueOf(serial.toUpperCase().replace(" ", "_"));
plugin.query.sendMessage(player, s.replace(serial, "<mob>"), type);
} catch (IllegalArgumentException e) {
player.sendMessage(s);
}
} else {
player.sendMessage(s);
}