mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-11 21:06:55 +00:00
return earlier if player has bypass permission
This commit is contained in:
+3
-3
@@ -17,6 +17,9 @@ public class CombatCommandListener implements Listener {
|
||||
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())
|
||||
@@ -27,9 +30,6 @@ public class CombatCommandListener implements Listener {
|
||||
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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user