constants do not need getters

This commit is contained in:
Luck 2017-01-12 21:14:27 +00:00
parent 0fe251b6ec
commit 2b96b656a9
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
15 changed files with 74 additions and 84 deletions

View File

@ -47,7 +47,7 @@ public class BukkitSenderFactory extends SenderFactory<CommandSender> {
if (sender instanceof Player) {
return sender.getName();
}
return Constants.getConsoleName();
return Constants.CONSOLE_NAME;
}
@Override
@ -55,7 +55,7 @@ public class BukkitSenderFactory extends SenderFactory<CommandSender> {
if (sender instanceof Player) {
return ((Player) sender).getUniqueId();
}
return Constants.getConsoleUUID();
return Constants.CONSOLE_UUID;
}
@Override

View File

@ -99,7 +99,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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) {

View File

@ -81,7 +81,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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);
}

View File

@ -105,7 +105,7 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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) {

View File

@ -271,7 +271,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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) {

View File

@ -45,7 +45,7 @@ public class BungeeSenderFactory extends SenderFactory<CommandSender> {
if (sender instanceof ProxiedPlayer) {
return sender.getName();
}
return Constants.getConsoleName();
return Constants.CONSOLE_NAME;
}
@Override
@ -53,7 +53,7 @@ public class BungeeSenderFactory extends SenderFactory<CommandSender> {
if (sender instanceof ProxiedPlayer) {
return ((ProxiedPlayer) sender).getUniqueId();
}
return Constants.getConsoleUUID();
return Constants.CONSOLE_UUID;
}
@Override

View File

@ -73,7 +73,7 @@ public class MigrationBungeePerms extends SubCommand<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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<Object> {
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) {

View File

@ -52,7 +52,7 @@ public class PermissionInfo extends SharedSubCommand {
@Override
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> 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 {

View File

@ -118,12 +118,12 @@ public class MigrationMainCommand extends MainCommand<Object> {
@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<String> 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;
}

View File

@ -113,7 +113,7 @@ public class ExportCommand extends SingleCommand {
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, List<String> 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);
}
}

View File

@ -87,7 +87,7 @@ public class AbstractSender<T> 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);
}
}

View File

@ -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";
}

View File

@ -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

View File

@ -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() + " "),

View File

@ -44,7 +44,7 @@ public class SpongeSenderFactory extends SenderFactory<CommandSource> {
if (source instanceof Player) {
return source.getName();
}
return Constants.getConsoleName();
return Constants.CONSOLE_NAME;
}
@Override
@ -52,7 +52,7 @@ public class SpongeSenderFactory extends SenderFactory<CommandSource> {
if (source instanceof Player) {
return ((Player) source).getUniqueId();
}
return Constants.getConsoleUUID();
return Constants.CONSOLE_UUID;
}
@SuppressWarnings("deprecation")