mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
bruh
This commit is contained in:
parent
86f3fd8d29
commit
8293b1a879
@ -165,20 +165,26 @@ public abstract class PlexCommand extends Command
|
||||
audience.sendMessage(component);
|
||||
}
|
||||
|
||||
protected void checkRank(Player player, Rank rank, String permission)
|
||||
protected boolean checkRank(Player player, Rank rank, String permission)
|
||||
{
|
||||
PlexPlayer plexPlayer = getPlexPlayer(player);
|
||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
send(player, "test ranks");
|
||||
if (!plexPlayer.getRank().equals(rank.toString()))
|
||||
{
|
||||
send(player, tl("noPermissionRank", rank.toString()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (plugin.getRanksOrPermissions().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!player.hasPermission(permission))
|
||||
{
|
||||
send(player, "test permissions");
|
||||
send(player, tl("noPermissionNode", permission));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isAdmin(PlexPlayer plexPlayer)
|
||||
|
@ -12,6 +12,7 @@ import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
|
||||
@ -26,10 +27,7 @@ public class PlexCMD extends PlexCommand {
|
||||
}
|
||||
if (args[0].equals("reload"))
|
||||
{
|
||||
if (!isSeniorAdmin(sender))
|
||||
{
|
||||
return tl("noPermission");
|
||||
}
|
||||
checkRank((Player)sender, Rank.SENIOR_ADMIN, "plex.reload");
|
||||
Plex.get().config.load();
|
||||
send(sender, "Reloaded config file");
|
||||
Plex.get().messages.load();
|
||||
|
Loading…
Reference in New Issue
Block a user