mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 07:10:46 +00:00
Add debug command for checking triggers on a group
This commit is contained in:
parent
cef8b53dd6
commit
82189e03ed
@ -1,12 +1,13 @@
|
|||||||
package emu.grasscutter.command.commands;
|
package emu.grasscutter.command.commands;
|
||||||
|
|
||||||
import static emu.grasscutter.utils.lang.Language.translate;
|
import emu.grasscutter.command.*;
|
||||||
|
|
||||||
import emu.grasscutter.command.Command;
|
|
||||||
import emu.grasscutter.command.CommandHandler;
|
|
||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.game.quest.GameQuest;
|
import emu.grasscutter.game.quest.GameQuest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static emu.grasscutter.utils.lang.Language.translate;
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
label = "quest",
|
label = "quest",
|
||||||
@ -131,6 +132,22 @@ public final class QuestCommand implements CommandHandler {
|
|||||||
"Triggers registered for %s: %s."
|
"Triggers registered for %s: %s."
|
||||||
.formatted(questId, String.join(", ", quest.getTriggers().keySet())));
|
.formatted(questId, String.join(", ", quest.getTriggers().keySet())));
|
||||||
}
|
}
|
||||||
|
case "grouptriggers" -> {
|
||||||
|
var scene = targetPlayer.getScene();
|
||||||
|
var scriptManager = scene.getScriptManager();
|
||||||
|
|
||||||
|
var group = scriptManager.getGroupById(questId);
|
||||||
|
if (group == null) {
|
||||||
|
CommandHandler.sendMessage(sender, "The group does not exist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandHandler.sendMessage(sender,
|
||||||
|
group.triggers.entrySet().stream()
|
||||||
|
.map(entry -> "%s: %s".formatted(entry.getKey(), entry.getValue()))
|
||||||
|
.collect(Collectors.joining(", "))
|
||||||
|
);
|
||||||
|
}
|
||||||
default -> this.sendUsageMessage(sender);
|
default -> this.sendUsageMessage(sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user