From 780145cf783ea76fe1bfee04cf89216bd4f92e1d Mon Sep 17 00:00:00 2001 From: Grafe Date: Wed, 13 Nov 2013 23:20:36 +0100 Subject: [PATCH] Players without the "dxl.cmdedit" permissions canit use any commands while in edit modus. We need a better solution though (cmd blacklist/whitelist for edit and game) --- .../dre/dungeonsxl/listener/PlayerListener.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/dre/dungeonsxl/listener/PlayerListener.java b/src/com/dre/dungeonsxl/listener/PlayerListener.java index 99048715..564c56b2 100644 --- a/src/com/dre/dungeonsxl/listener/PlayerListener.java +++ b/src/com/dre/dungeonsxl/listener/PlayerListener.java @@ -397,15 +397,17 @@ public class PlayerListener implements Listener { if (p.permission.has(event.getPlayer(), "dungeonsxl.cmd") || event.getPlayer().isOp()) { return; } - + DPlayer dplayer = DPlayer.get(event.getPlayer()); if (dplayer != null) { - if (!dplayer.isEditing) { - String[] splittedCmd = event.getMessage().split(" "); - if (!splittedCmd[0].equalsIgnoreCase("/dungeon") && !splittedCmd[0].equalsIgnoreCase("/dungeonsxl") && !splittedCmd[0].equalsIgnoreCase("/dxl")) { - p.msg(event.getPlayer(), p.language.get("Error_Cmd")); - event.setCancelled(true); - } + if (dplayer.isEditing && p.permission.has(event.getPlayer(), "dungeonsxl.cmdedit") || event.getPlayer().isOp()){ + return; + } + + String[] splittedCmd = event.getMessage().split(" "); + if (!splittedCmd[0].equalsIgnoreCase("/dungeon") && !splittedCmd[0].equalsIgnoreCase("/dungeonsxl") && !splittedCmd[0].equalsIgnoreCase("/dxl")) { + p.msg(event.getPlayer(), p.language.get("Error_Cmd")); + event.setCancelled(true); } } }