Solve kill-players objective not showing, part 2. Fixes #598

This commit is contained in:
BuildTools 2018-12-30 14:22:25 -05:00
parent 50ad660cf5
commit 0857f1079d

View File

@ -1970,14 +1970,20 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
} }
} }
} else if (obj.contains(Lang.get(quester.getPlayer(), "kill"))) { } else if (obj.contains(Lang.get(quester.getPlayer(), "kill"))) {
if (stage.mobsToKill == null || stage.mobsToKill.isEmpty()) {
// Could be Kill a Player objective
quester.getPlayer().sendMessage(obj);
return;
}
for (EntityType type : stage.mobsToKill) { for (EntityType type : stage.mobsToKill) {
try { try {
EntityType et = EntityType.valueOf(serial.toUpperCase().replace(" ", "_")); EntityType et = EntityType.valueOf(serial.toUpperCase().replace(" ", "_"));
if (et.equals(type)) { if (et.equals(type)) {
query.sendMessage(quester.getPlayer(), obj.replace(serial, "<mob>"), type); query.sendMessage(quester.getPlayer(), obj.replace(serial, "<mob>"), type);
break;
} }
} catch (IllegalArgumentException iae) { } catch (IllegalArgumentException iae) {
// Could be Kill a Player objective // Could be Kill a Player objective
quester.getPlayer().sendMessage(obj); quester.getPlayer().sendMessage(obj);
} }
break; break;