mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16: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())
|
if (!PreventStabby.getPlugin().getConfigCache().isBlock_commands_in_combat())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (event.getPlayer().hasPermission("toglepvp.combatcommandblock.bypass"))
|
||||||
|
return;
|
||||||
|
|
||||||
PlayerManager playerManager = PreventStabby.getPlugin().getPlayerManager();
|
PlayerManager playerManager = PreventStabby.getPlugin().getPlayerManager();
|
||||||
|
|
||||||
if (!playerManager.getPlayer(event.getPlayer().getUniqueId()).isInCombat())
|
if (!playerManager.getPlayer(event.getPlayer().getUniqueId()).isInCombat())
|
||||||
@@ -27,9 +30,6 @@ public class CombatCommandListener implements Listener {
|
|||||||
if (!PreventStabby.getPlugin().getConfigCache().getCombatBlockedCommands().contains(command))
|
if (!PreventStabby.getPlugin().getConfigCache().getCombatBlockedCommands().contains(command))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.getPlayer().hasPermission("toglepvp.combatcommandblock.bypass"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
PluginMessages.sendMessage(event.getPlayer(), PreventStabby.getPlugin().getConfigCache().getCant_do_that_during_combat());
|
PluginMessages.sendMessage(event.getPlayer(), PreventStabby.getPlugin().getConfigCache().getCant_do_that_during_combat());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user