mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 09:37:37 +00:00
fix ranks in commandblocker for inactive admins
This commit is contained in:
parent
245f7dd4d3
commit
9f0b8fb56a
@ -6,6 +6,8 @@ import dev.plex.cmdblocker.BaseCommand;
|
|||||||
import dev.plex.cmdblocker.MatchCommand;
|
import dev.plex.cmdblocker.MatchCommand;
|
||||||
import dev.plex.cmdblocker.RegexCommand;
|
import dev.plex.cmdblocker.RegexCommand;
|
||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
|
import dev.plex.player.PlexPlayer;
|
||||||
|
import dev.plex.rank.enums.Rank;
|
||||||
import dev.plex.util.PlexUtils;
|
import dev.plex.util.PlexUtils;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -38,7 +40,8 @@ public class CommandListener extends PlexListener
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String message = event.getMessage().substring(1).stripLeading(); // stripLeading() is VITAL for workaround blocking (/ minecraft:summon)
|
String message = event.getMessage().substring(1).stripLeading(); // stripLeading() is VITAL for workaround blocking (/ minecraft:summon)
|
||||||
for (BaseCommand blockedCommand : plugin.getCommandBlockerManager().getBlockedCommands()) {
|
for (BaseCommand blockedCommand : plugin.getCommandBlockerManager().getBlockedCommands()) {
|
||||||
if (DataUtils.getPlayer(player.getUniqueId()).getRankFromString().ordinal() > blockedCommand.getRank().ordinal())
|
PlexPlayer plexPlayer = DataUtils.getPlayer(player.getUniqueId());
|
||||||
|
if (Math.min(plexPlayer.getRankFromString().ordinal(), (plexPlayer.isAdminActive() ? Rank.EXECUTIVE : Rank.OP).ordinal()) > blockedCommand.getRank().ordinal())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user