Commit b44df66c authored by Jaida Wu's avatar Jaida Wu
Browse files

Save account to database


Signed-off-by: default avatarJaida Wu <mlgmxyysd@meowcat.org>
parent 63cb0a81
......@@ -129,7 +129,7 @@ public final class CommandMap {
if (player != null) {
String permissionNode = this.annotations.get(label).permission();
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.");
return;
}
......
......@@ -48,6 +48,7 @@ public class Account implements CommandHandler {
} else {
CommandHandler.sendMessage(null, "Account created with UID " + account.getPlayerId() + ".");
account.addPermission("*"); // Grant the player superuser permissions.
account.save(); // Save account to database.
}
return;
case "delete":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment