From c3b0aa2d97d21cb2930a487a73f1edb00d748b66 Mon Sep 17 00:00:00 2001 From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com> Date: Thu, 11 Jul 2024 00:42:10 +0200 Subject: [PATCH] Optimized Command Permission check --- .../classic/commands/arguments/PluginArgumentsRegistry.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/PluginArgumentsRegistry.java b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/PluginArgumentsRegistry.java index 3e6101b..857f7b4 100644 --- a/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/PluginArgumentsRegistry.java +++ b/MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/commands/arguments/PluginArgumentsRegistry.java @@ -139,10 +139,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String if(argument.getArgumentName().equalsIgnoreCase(args[0])) { boolean gotPermissions = false; for(String perm : argument.getPermissions()) { - if(perm.isEmpty()) { - continue; - } - if(plugin.getBukkitHelper().hasPermission(sender, perm)) { + if(perm.isEmpty() || plugin.getBukkitHelper().hasPermission(sender, perm)) { gotPermissions = true; } }