mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Allow server owners to use plex update
This commit is contained in:
parent
ebfba89994
commit
8ab337d0a6
@ -94,9 +94,9 @@ public class PlexCMD extends PlexCommand
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("update"))
|
||||
{
|
||||
if (sender instanceof Player && !PlexUtils.DEVELOPERS.contains(playerSender.getUniqueId().toString()))
|
||||
if (!hasUpdateAccess(playerSender, sender))
|
||||
{
|
||||
return messageComponent("noPermissionRank", "a developer");
|
||||
return messageComponent("noPermissionRank", "an Owner or Developer");
|
||||
}
|
||||
for (PlexModule module : plugin.getModuleManager().getModules())
|
||||
{
|
||||
@ -108,9 +108,9 @@ public class PlexCMD extends PlexCommand
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("update"))
|
||||
{
|
||||
if (sender instanceof Player && !PlexUtils.DEVELOPERS.contains(playerSender.getUniqueId().toString()))
|
||||
if (!hasUpdateAccess(playerSender, sender))
|
||||
{
|
||||
return messageComponent("noPermissionRank", "a developer");
|
||||
return messageComponent("noPermissionRank", "an Owner or Developer");
|
||||
}
|
||||
if (!plugin.getUpdateChecker().getUpdateStatusMessage(sender, false, 0))
|
||||
{
|
||||
@ -139,4 +139,15 @@ public class PlexCMD extends PlexCommand
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private boolean hasUpdateAccess(Player player, CommandSender sender)
|
||||
{
|
||||
if (isConsole(sender))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
assert player != null;
|
||||
return PlexUtils.DEVELOPERS.contains(player.getUniqueId().toString())
|
||||
|| plugin.config.getStringList("titles.owners").contains(player.getName());
|
||||
}
|
||||
}
|
@ -31,7 +31,7 @@ public class PlexUtils implements PlexBase
|
||||
|
||||
public static List<String> DEVELOPERS =
|
||||
Arrays.asList("78408086-1991-4c33-a571-d8fa325465b2", // Telesphoreo
|
||||
/*"f5cd54c4-3a24-4213-9a56-c06c49594dff",*/ // Taahh
|
||||
"f5cd54c4-3a24-4213-9a56-c06c49594dff", // Taahh
|
||||
"53b1512e-3481-4702-9f4f-63cb9c8be6a1", // supernt
|
||||
"ca83b658-c03b-4106-9edc-72f70a80656d", // ayunami2000
|
||||
"2e06e049-24c8-42e4-8bcf-d35372af31e6", // Fleek
|
||||
|
Loading…
Reference in New Issue
Block a user