From b808e7e4ff6e6670af7e1e85e83eaf286bc6cce0 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Mon, 1 May 2023 19:45:32 -0400 Subject: [PATCH] Add sub-command to `/quest` which allows for quests to be added/removed from the logger --- .../emu/grasscutter/command/commands/QuestCommand.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/emu/grasscutter/command/commands/QuestCommand.java b/src/main/java/emu/grasscutter/command/commands/QuestCommand.java index c97c406ec..eb2074082 100644 --- a/src/main/java/emu/grasscutter/command/commands/QuestCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/QuestCommand.java @@ -94,6 +94,16 @@ public final class QuestCommand implements CommandHandler { String.join(", ", dungeons.intStream() .mapToObj(String::valueOf).toList())); } + case "debug" -> { + var loggedQuests = targetPlayer.getQuestManager().getLoggedQuests(); + var shouldAdd = !loggedQuests.contains(questId); + + if (shouldAdd) loggedQuests.add(questId); + else loggedQuests.removeInt(questId); + + CommandHandler.sendMessage(sender, "Quest %s will %s." + .formatted(questId, shouldAdd ? "now be logged" : "no longer be logged")); + } default -> this.sendUsageMessage(sender); } }