config for startup commands

This commit is contained in:
granny
2025-01-12 18:07:25 -08:00
committed by granny
parent 194d9685b2
commit e0db368062
3 changed files with 29 additions and 49 deletions

View File

@@ -583,4 +583,16 @@ public class PurpurConfig {
private static void registerMinecraftDebugCommands() {
registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
}
public static List<String> startupCommands = new ArrayList<>();
private static void startupCommands() {
startupCommands.clear();
getList("settings.startup-commands", new ArrayList<String>()).forEach(line -> {
String command = line.toString();
if (command.startsWith("/")) {
command = command.substring(1);
}
startupCommands.add(command);
});
}
}