Permit use of /questadmin setstage with spaced quest names, fixes #1211

This commit is contained in:
PikaMug 2020-04-17 02:42:22 -04:00
parent 37a6cb438a
commit 17ee93d7e8
2 changed files with 6 additions and 4 deletions

View File

@ -1224,7 +1224,7 @@ public class CmdExecutor implements CommandExecutor {
int stage = -1;
if (args.length > 3) {
try {
stage = Integer.parseInt(args[3]);
stage = Integer.parseInt(args[args.length - 1]);
} catch (NumberFormatException e) {
cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum"));
}

View File

@ -1068,9 +1068,11 @@ public class PlayerListener implements Listener {
if (plugin.canUseQuests(uuid)) {
Quester quester = plugin.getQuester(uuid);
for (Quest quest : plugin.getQuests()) {
if (quester.getCurrentQuests().containsKey(quest)
&& quester.getCurrentStage(quest).containsObjective("reachLocation")) {
quester.reachLocation(quest, location);
if (quester.getCurrentQuests().containsKey(quest)) {
if (quester.getCurrentStage(quest) != null
&& quester.getCurrentStage(quest).containsObjective("reachLocation")) {
quester.reachLocation(quest, location);
}
}
quester.dispatchMultiplayerEverything(quest, "reachLocation", (Quester q) -> {