Skip to content

Commit

Permalink
Also block /deop
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Dec 2, 2018
1 parent db35c90 commit 693314c
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -78,7 +78,7 @@
public class WorldGuardPlayerListener implements Listener {

private static final Logger log = Logger.getLogger(WorldGuardPlayerListener.class.getCanonicalName());
private static final Pattern opPattern = Pattern.compile("^/(?:minecraft:)(?:bukkit:)?op(?:\\s.*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern opPattern = Pattern.compile("^/(?:minecraft:)?(?:bukkit:)?(?:de)?op(?:\\s.*)?$", Pattern.CASE_INSENSITIVE);
private WorldGuardPlugin plugin;

/**
Expand Down Expand Up @@ -487,7 +487,7 @@ public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {

if (cfg.blockInGameOp) {
if (opPattern.matcher(event.getMessage()).matches()) {
player.sendMessage(ChatColor.RED + "/op can only be used in console (as set by a WG setting).");
player.sendMessage(ChatColor.RED + "/op and /deop can only be used in console (as set by a WG setting).");
event.setCancelled(true);
return;
}
Expand Down

0 comments on commit 693314c

Please sign in to comment.