make vault optional and automatically enable if a server is using vault

This commit is contained in:
Taah
2022-05-10 22:48:47 -07:00
parent bb8c34e0cd
commit b78f71c238
12 changed files with 151 additions and 47 deletions

View File

@ -151,7 +151,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (!perms.permission().isEmpty() && !player.hasPermission(perms.permission()))
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(player, perms.permission()))
{
send(sender, messageComponent("noPermissionNode", perms.permission()));
return true;
@ -187,7 +187,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), perms.permission()))
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(Bukkit.getOfflinePlayer(plexPlayer.getName()), perms.permission()))
{
send(sender, messageComponent("noPermissionNode", perms.permission()));
return true;
@ -306,7 +306,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getUuid()), permission))
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(Bukkit.getOfflinePlayer(plexPlayer.getName()), perms.permission()))
{
throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission));
}
@ -344,7 +344,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (!perms.permission().isEmpty() && !player.hasPermission(permission))
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(player, permission))
{
throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission));
}
@ -365,7 +365,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
return !perms.permission().isEmpty() && player.hasPermission(permission);
return !perms.permission().isEmpty() && plugin.getPermissionHandler().hasPermission(player, permission);
}
return false;
}
@ -406,7 +406,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
return !perms.permission().isEmpty() && player.hasPermission(permission);
return !perms.permission().isEmpty() && plugin.getPermissionHandler().hasPermission(player, permission);
}
return true;
}

View File

@ -46,7 +46,7 @@ public class AdminChatCMD extends PlexCommand
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (player.hasPermission("plex.adminchat"))
if (plugin.getPermissionHandler().hasPermission(player, "plex.adminchat"))
{
player.sendMessage(PlexUtils.messageComponent("adminChatFormat", sender.getName(), message));
}