Add triggers list for quest debugging

This commit is contained in:
KingRainbow44 2023-05-02 22:43:37 -04:00
parent 1c2bdff9dc
commit d3c7377946
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -99,11 +99,21 @@ public final class QuestCommand implements CommandHandler {
var shouldAdd = !loggedQuests.contains(questId);
if (shouldAdd) loggedQuests.add(questId);
else loggedQuests.removeInt(questId);
else loggedQuests.remove(questId);
CommandHandler.sendMessage(sender, "Quest %s will %s."
.formatted(questId, shouldAdd ? "now be logged" : "no longer be logged"));
}
case "triggers" -> {
var quest = targetPlayer.getQuestManager().getQuestById(questId);
if (quest == null) {
CommandHandler.sendMessage(sender, translate(sender, "commands.quest.not_found"));
return;
}
CommandHandler.sendMessage(sender, "Triggers registered for %s: %s."
.formatted(questId, String.join(", ", quest.getTriggers().keySet())));
}
default -> this.sendUsageMessage(sender);
}
}