Permalink
Browse files

Also block /deop

  • Loading branch information...
me4502 committed Dec 2, 2018
1 parent db35c90 commit 693314c7f70a389fb1e8e2cf0a19683f55364985
@@ -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;
/**
@@ -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;
}

0 comments on commit 693314c

Please sign in to comment.