Skip to content

Commit

Permalink
return earlier if player has bypass permission
Browse files Browse the repository at this point in the history
  • Loading branch information
YouHaveTrouble committed Mar 17, 2022
1 parent cd26d62 commit 52fb010
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public void onPlayerCommandInCombat(org.bukkit.event.player.PlayerCommandPreproc
if (!PreventStabby.getPlugin().getConfigCache().isBlock_commands_in_combat())
return;

if (event.getPlayer().hasPermission("toglepvp.combatcommandblock.bypass"))
return;

PlayerManager playerManager = PreventStabby.getPlugin().getPlayerManager();

if (!playerManager.getPlayer(event.getPlayer().getUniqueId()).isInCombat())
Expand All @@ -27,9 +30,6 @@ public void onPlayerCommandInCombat(org.bukkit.event.player.PlayerCommandPreproc
if (!PreventStabby.getPlugin().getConfigCache().getCombatBlockedCommands().contains(command))
return;

if (event.getPlayer().hasPermission("toglepvp.combatcommandblock.bypass"))
return;

event.setCancelled(true);
PluginMessages.sendMessage(event.getPlayer(), PreventStabby.getPlugin().getConfigCache().getCant_do_that_during_combat());

Expand Down

0 comments on commit 52fb010

Please sign in to comment.