mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-24 00:11:31 +00:00
Save account to database
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
parent
c42d6d81f6
commit
87c7fba2d2
@ -129,7 +129,7 @@ public final class CommandMap {
|
|||||||
if (player != null) {
|
if (player != null) {
|
||||||
String permissionNode = this.annotations.get(label).permission();
|
String permissionNode = this.annotations.get(label).permission();
|
||||||
Account account = player.getAccount();
|
Account account = player.getAccount();
|
||||||
if (!Objects.equals(permissionNode, "") && !account.hasPermission(permissionNode)) {
|
if (!permissionNode.equals("") && !account.hasPermission(permissionNode)) {
|
||||||
CommandHandler.sendMessage(player, "You do not have permission to run this command.");
|
CommandHandler.sendMessage(player, "You do not have permission to run this command.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ public class Account implements CommandHandler {
|
|||||||
} else {
|
} else {
|
||||||
CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerId() + ".");
|
CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerId() + ".");
|
||||||
account.addPermission("*"); // Grant the player superuser permissions.
|
account.addPermission("*"); // Grant the player superuser permissions.
|
||||||
|
account.save(); // Save account to database.
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case "delete":
|
case "delete":
|
||||||
|
Loading…
Reference in New Issue
Block a user