From 3414f28a8175bd49d78652585da8c2e7d4423ad8 Mon Sep 17 00:00:00 2001 From: memetrollsXD Date: Thu, 28 Apr 2022 00:18:59 +0200 Subject: [PATCH] Apply to account command --- .../grasscutter/command/commands/AccountCommand.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/AccountCommand.java b/src/main/java/emu/grasscutter/command/commands/AccountCommand.java index 68da1569a..52848e56c 100644 --- a/src/main/java/emu/grasscutter/command/commands/AccountCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/AccountCommand.java @@ -1,5 +1,6 @@ package emu.grasscutter.command.commands; +import emu.grasscutter.Grasscutter; import emu.grasscutter.command.Command; import emu.grasscutter.command.CommandHandler; import emu.grasscutter.database.DatabaseHelper; @@ -7,8 +8,7 @@ import emu.grasscutter.game.player.Player; import java.util.List; -@Command(label = "account", usage = "account [uid]", - description = "Modify user accounts") +@Command(label = "account", usage = "account [uid]", description = "Modify user accounts") public final class AccountCommand implements CommandHandler { @Override @@ -47,7 +47,13 @@ public final class AccountCommand implements CommandHandler { return; } else { CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerUid() + "."); - account.addPermission("*"); // Grant the player superuser permissions. + + for (String permission : Grasscutter.getConfig().getDispatchOptions().defaultPermissions) { + if (!permission.isBlank()) { + account.addPermission(permission); + } + } + account.save(); // Save account to database. } return;