diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java index 7c7e0d28e..c264998d4 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitSenderFactory.java @@ -47,7 +47,7 @@ public class BukkitSenderFactory extends SenderFactory { if (sender instanceof Player) { return sender.getName(); } - return Constants.getConsoleName(); + return Constants.CONSOLE_NAME; } @Override @@ -55,7 +55,7 @@ public class BukkitSenderFactory extends SenderFactory { if (sender instanceof Player) { return ((Player) sender).getUniqueId(); } - return Constants.getConsoleUUID(); + return Constants.CONSOLE_UUID; } @Override diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java index 2cdb4bb19..4e8ea5385 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java @@ -99,7 +99,7 @@ public class MigrationBPermissions extends SubCommand { try { holder.setPermission(p.name(), p.isTrue(), "global", world.getName()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + p.name() + " " + p.isTrue() + " global " + world.getName()) .build().submit(plugin); } catch (Exception ex) { @@ -113,7 +113,7 @@ public class MigrationBPermissions extends SubCommand { try { holder.setPermission(child.getKey(), child.getValue(), "global", world.getName()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + child.getKey() + " " + child.getValue() + " global " + world.getName()) .build().submit(plugin); } catch (Exception ex) { @@ -129,7 +129,7 @@ public class MigrationBPermissions extends SubCommand { try { holder.setPermission("group." + parent.getName(), true, "global", world.getName()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("setinherit " + parent.getName() + " global " + world.getName()) .build().submit(plugin); } catch (Exception ex) { @@ -146,7 +146,7 @@ public class MigrationBPermissions extends SubCommand { try { holder.setPermission(meta.getKey().toLowerCase() + "." + c.getPriority() + "." + chatMeta, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + meta.getKey().toLowerCase() + "." + c.getPriority() + "." + chatMeta + " true") .build().submit(plugin); } catch (Exception ex) { @@ -160,7 +160,7 @@ public class MigrationBPermissions extends SubCommand { try { holder.setPermission("meta." + meta.getKey() + "." + meta.getValue(), true, "global", world.getName()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set meta." + meta.getKey() + "." + meta.getValue() + " true global " + world.getName()) .build().submit(plugin); } catch (Exception ex) { @@ -215,7 +215,7 @@ public class MigrationBPermissions extends SubCommand { me.lucko.luckperms.common.core.model.Group lpGroup = plugin.getGroupManager().getIfLoaded(groupName); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("create") .build().submit(plugin); } catch (Exception ex) { diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java index 28a67c637..44237a892 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java @@ -81,7 +81,7 @@ public class MigrationGroupManager extends SubCommand { me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(g.getName().toLowerCase()); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("create") .build().submit(plugin); } catch (Exception ex) { @@ -101,7 +101,7 @@ public class MigrationGroupManager extends SubCommand { try { group.setPermission(node, value); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set " + node + " " + value) .build().submit(plugin); } catch (Exception ex) { @@ -115,7 +115,7 @@ public class MigrationGroupManager extends SubCommand { try { group.setPermission("group." + s.toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("setinherit " + s.toLowerCase()) .build().submit(plugin); } catch (Exception ex) { @@ -204,7 +204,7 @@ public class MigrationGroupManager extends SubCommand { me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(e.getKey()); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("create") .build().submit(plugin); } catch (Exception ex) { @@ -222,12 +222,12 @@ public class MigrationGroupManager extends SubCommand { if (n.getKey().getValue().startsWith("group.")) { String groupName = n.getKey().getValue().substring(6); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("setinherit " + groupName + " global " + n.getKey().getKey()) .build().submit(plugin); } else { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set " + n.getKey().getValue() + " " + n.getValue() + " global " + n.getKey().getKey()) .build().submit(plugin); } @@ -256,12 +256,12 @@ public class MigrationGroupManager extends SubCommand { if (n.getKey().getValue().startsWith("group.")) { String group = n.getKey().getValue().substring(6); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + group + " global " + n.getKey().getKey()) .build().submit(plugin); } else { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set " + n.getKey().getValue() + " " + n.getValue() + " global " + n.getKey().getKey()) .build().submit(plugin); } diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java index 17b5db404..b716c1ce5 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java @@ -105,7 +105,7 @@ public class MigrationPermissionsEx extends SubCommand { Group lpGroup = plugin.getGroupManager().getIfLoaded(name); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("create") .build().submit(plugin); } catch (Exception ex) { @@ -123,7 +123,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission(node, value); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("set " + node + " " + value) .build().submit(plugin); } catch (Exception ex) { @@ -148,7 +148,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission(node, value, "global", world); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("set " + node + " " + value + " global " + world) .build().submit(plugin); } catch (Exception ex) { @@ -164,7 +164,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission("group." + g.getName().toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("setinherit " + g.getName().toLowerCase()) .build().submit(plugin); } catch (Exception ex) { @@ -180,7 +180,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission("group." + g.getName().toLowerCase(), true, "global", world); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("setinherit " + g.getName().toLowerCase() + " global " + world) .build().submit(plugin); } catch (Exception ex) { @@ -200,7 +200,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission("prefix." + groupWeight + "." + prefix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("set prefix." + groupWeight + "." + prefix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -215,7 +215,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpGroup.setPermission("suffix." + groupWeight + "." + suffix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpGroup).action("set suffix." + groupWeight + "." + suffix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -267,7 +267,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission(node, value); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("set " + node + " " + value) .build().submit(plugin); } catch (Exception ex) { @@ -292,7 +292,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission(node, value, "global", world); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("set " + node + " " + value + " global " + world) .build().submit(plugin); } catch (Exception ex) { @@ -308,7 +308,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission("group." + s.toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("addgroup " + s.toLowerCase()) .build().submit(plugin); } catch (Exception ex) { @@ -324,7 +324,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission("group." + s.toLowerCase(), true, "global", world); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("addgroup " + s.toLowerCase() + " global " + world) .build().submit(plugin); } catch (Exception ex) { @@ -344,7 +344,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission("prefix." + maxGroupWeight + "." + prefix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("set prefix." + maxGroupWeight + "." + prefix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -359,7 +359,7 @@ public class MigrationPermissionsEx extends SubCommand { try { lpUser.setPermission("suffix." + maxGroupWeight + "." + suffix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(lpUser).action("set suffix." + maxGroupWeight + "." + suffix + " true") .build().submit(plugin); } catch (Exception ex) { diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java index 6b9a3fd2e..3b89a8b53 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java @@ -271,7 +271,7 @@ public class MigrationPowerfulPerms extends SubCommand { final me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(g.getName().toLowerCase()); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("create") .build().submit(plugin); } catch (Exception ex) { @@ -286,7 +286,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { group.setPermission("group." + parent.getName().toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("setinherit " + parent.getName().toLowerCase()) // All versions .build().submit(plugin); } catch (Exception ex) { @@ -353,7 +353,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + g.getName().toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + g.getName().toLowerCase()) .build().submit(plugin); } catch (Exception ex) { @@ -365,7 +365,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + g.getName().toLowerCase(), true, server); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + g.getName().toLowerCase() + " " + server) .build().submit(plugin); } catch (Exception ex) { @@ -386,7 +386,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + group.getName().toLowerCase(), true, g.getExpirationDate().getTime() / 1000L); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addtempgroup " + group.getName().toLowerCase() + " " + g.getExpirationDate().getTime() / 1000L) .build().submit(plugin); } catch (Exception ex) { @@ -398,7 +398,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + group.getName().toLowerCase(), true, server, g.getExpirationDate().getTime() / 1000L); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addtempgroup " + group.getName().toLowerCase() + " " + g.getExpirationDate().getTime() / 1000L + " " + server) .build().submit(plugin); } catch (Exception ex) { @@ -413,7 +413,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + group.getName().toLowerCase(), true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + group.getName().toLowerCase()) .build().submit(plugin); } catch (Exception ex) { @@ -425,7 +425,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { user.setPermission("group." + group.getName().toLowerCase(), true, server); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + group.getName().toLowerCase() + " " + server) .build().submit(plugin); } catch (Exception ex) { @@ -549,7 +549,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value, server, world); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + node + " " + value + " " + server + " " + world) .build().submit(plugin); } catch (Exception ex) { @@ -561,7 +561,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value, server, world, expireAt); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("settemp " + node + " " + value + " " + expireAt + " " + server + " " + world) .build().submit(plugin); } catch (Exception ex) { @@ -576,7 +576,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value, server); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + node + " " + value + " " + server) .build().submit(plugin); } catch (Exception ex) { @@ -588,7 +588,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value, server, expireAt); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("settemp " + node + " " + value + " " + expireAt + " " + server) .build().submit(plugin); } catch (Exception ex) { @@ -602,7 +602,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("set " + node + " " + value) .build().submit(plugin); } catch (Exception ex) { @@ -614,7 +614,7 @@ public class MigrationPowerfulPerms extends SubCommand { try { holder.setPermission(node, value, expireAt); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(holder).action("settemp " + node + " " + value + " " + expireAt) .build().submit(plugin); } catch (Exception ex) { diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java index 7c5619d02..fb67e1fc9 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeSenderFactory.java @@ -45,7 +45,7 @@ public class BungeeSenderFactory extends SenderFactory { if (sender instanceof ProxiedPlayer) { return sender.getName(); } - return Constants.getConsoleName(); + return Constants.CONSOLE_NAME; } @Override @@ -53,7 +53,7 @@ public class BungeeSenderFactory extends SenderFactory { if (sender instanceof ProxiedPlayer) { return ((ProxiedPlayer) sender).getUniqueId(); } - return Constants.getConsoleUUID(); + return Constants.CONSOLE_UUID; } @Override diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java index 71195b3da..868b7502f 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java @@ -73,7 +73,7 @@ public class MigrationBungeePerms extends SubCommand { me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(g.getName().toLowerCase()); try { LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("create") .build().submit(plugin); } catch (Exception ex) { @@ -86,7 +86,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission(perm, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set " + perm + " true") .build().submit(plugin); } catch (Exception ex) { @@ -102,7 +102,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission(perm, true, e.getKey()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set " + perm + " true " + e.getKey()) .build().submit(plugin); } catch (Exception ex) { @@ -118,7 +118,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission(perm, true, e.getKey(), we.getKey()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set " + perm + " true " + e.getKey() + " " + we.getKey()) .build().submit(plugin); } catch (Exception ex) { @@ -135,7 +135,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission("group." + inherit, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("setinherit " + group) .build().submit(plugin); } catch (Exception ex) { @@ -154,7 +154,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission("prefix.50." + prefix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set prefix.50." + prefix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -169,7 +169,7 @@ public class MigrationBungeePerms extends SubCommand { try { group.setPermission("suffix.50." + suffix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(group).action("set suffix.50." + suffix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -201,7 +201,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission(perm, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set " + perm + " true") .build().submit(plugin); } catch (Exception ex) { @@ -217,7 +217,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission(perm, true, e.getKey()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set " + perm + " true " + e.getKey()) .build().submit(plugin); } catch (Exception ex) { @@ -233,7 +233,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission(perm, true, e.getKey(), we.getKey()); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set " + perm + " true " + e.getKey() + " " + we.getKey()) .build().submit(plugin); } catch (Exception ex) { @@ -250,7 +250,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission("group." + group, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("addgroup " + group) .build().submit(plugin); } catch (Exception ex) { @@ -269,7 +269,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission("prefix.100." + prefix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set prefix.100." + prefix + " true") .build().submit(plugin); } catch (Exception ex) { @@ -284,7 +284,7 @@ public class MigrationBungeePerms extends SubCommand { try { user.setPermission("suffix.100." + suffix, true); LogEntry.build() - .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) + .actor(Constants.CONSOLE_UUID).actorName(Constants.CONSOLE_NAME) .acted(user).action("set suffix.100." + suffix + " true") .build().submit(plugin); } catch (Exception ex) { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java index 051491cd9..ad670bc17 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/generic/permission/PermissionInfo.java @@ -52,7 +52,7 @@ public class PermissionInfo extends SharedSubCommand { @Override public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label) throws CommandException { - if (sender.getUuid().equals(Constants.getConsoleUUID())) { + if (sender.getUuid().equals(Constants.CONSOLE_UUID)) { Message.LISTNODES.send(sender, holder.getFriendlyName()); sender.sendMessage(Util.color(Util.permNodesToStringConsole(holder.getPermissions(false)))); } else { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java index 9b2325ee2..286073c89 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/migration/MigrationMainCommand.java @@ -118,12 +118,12 @@ public class MigrationMainCommand extends MainCommand { @Override public boolean isAuthorized(Sender sender) { - return sender.getUuid().equals(Constants.getConsoleUUID()); + return sender.getUuid().equals(Constants.CONSOLE_UUID); } @Override public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Void v, List args, String label) throws CommandException { - if (!sender.getUuid().equals(Constants.getConsoleUUID())) { + if (!sender.getUuid().equals(Constants.CONSOLE_UUID)) { Message.MIGRATION_NOT_CONSOLE.send(sender); return CommandResult.NO_PERMISSION; } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java index 192889f5e..02cb1fbda 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/ExportCommand.java @@ -113,7 +113,7 @@ public class ExportCommand extends SingleCommand { public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List args, String label) { final Logger log = plugin.getLog(); - if (!sender.getUuid().equals(Constants.getConsoleUUID())) { + if (!sender.getUuid().equals(Constants.CONSOLE_UUID)) { Message.MIGRATION_NOT_CONSOLE.send(sender); return CommandResult.NO_PERMISSION; } @@ -224,7 +224,7 @@ public class ExportCommand extends SingleCommand { @Override public boolean isAuthorized(Sender sender) { - return sender.getUuid().equals(Constants.getConsoleUUID()); + return sender.getUuid().equals(Constants.CONSOLE_UUID); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java index 3cd826ae0..997f30f28 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java @@ -87,7 +87,7 @@ public class AbstractSender implements Sender { } private boolean isConsole() { - return this.uuid.equals(Constants.getConsoleUUID()) || this.uuid.equals(Constants.getImporterUUID()); + return this.uuid.equals(Constants.CONSOLE_UUID) || this.uuid.equals(Constants.IMPORT_UUID); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java b/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java index d4e07d886..d36cd8673 100644 --- a/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java +++ b/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java @@ -22,7 +22,6 @@ package me.lucko.luckperms.common.constants; -import lombok.Getter; import lombok.experimental.UtilityClass; import java.util.UUID; @@ -30,19 +29,10 @@ import java.util.UUID; @UtilityClass public class Constants { - @Getter - private static final UUID consoleUUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); - - @Getter - private static final String consoleName = "Console"; - - @Getter - private static final UUID importerUUID = UUID.fromString("11111111-1111-1111-1111-111111111111"); - - @Getter - private static final String importerName = "Import"; - - @Getter - private static final String logFormat = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s"; + public static final UUID CONSOLE_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); + public static final String CONSOLE_NAME = "Console"; + public static final UUID IMPORT_UUID = UUID.fromString("11111111-1111-1111-1111-111111111111"); + public static final String IMPORT_NAME = "Import"; + public static final String LOG_FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s"; } diff --git a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java index e2bfd2071..5c06fa0d5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/Importer.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/Importer.java @@ -201,12 +201,12 @@ public class Importer { @Override public String getName() { - return Constants.getImporterName(); + return Constants.IMPORT_NAME; } @Override public UUID getUuid() { - return Constants.getImporterUUID(); + return Constants.IMPORT_UUID; } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java index f839792ac..aa744ad8d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java @@ -121,7 +121,7 @@ abstract class FlatfileBacking extends AbstractBacking { @Override public boolean logAction(LogEntry entry) { actionLogger.info(String.format(LOG_FORMAT, - (entry.getActor().equals(Constants.getConsoleUUID()) ? "" : entry.getActor() + " "), + (entry.getActor().equals(Constants.CONSOLE_UUID) ? "" : entry.getActor() + " "), entry.getActorName(), Character.toString(entry.getType()), (entry.getActed() == null ? "" : entry.getActed().toString() + " "), diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java index 58385b57f..a5701a704 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeSenderFactory.java @@ -44,7 +44,7 @@ public class SpongeSenderFactory extends SenderFactory { if (source instanceof Player) { return source.getName(); } - return Constants.getConsoleName(); + return Constants.CONSOLE_NAME; } @Override @@ -52,7 +52,7 @@ public class SpongeSenderFactory extends SenderFactory { if (source instanceof Player) { return ((Player) source).getUniqueId(); } - return Constants.getConsoleUUID(); + return Constants.CONSOLE_UUID; } @SuppressWarnings("deprecation")