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)

This commit is contained in:
Grafe 2013-11-13 23:20:36 +01:00
parent e1e94f5bfe
commit 780145cf78

View File

@ -397,15 +397,17 @@ public class PlayerListener implements Listener {
if (p.permission.has(event.getPlayer(), "dungeonsxl.cmd") || event.getPlayer().isOp()) { if (p.permission.has(event.getPlayer(), "dungeonsxl.cmd") || event.getPlayer().isOp()) {
return; return;
} }
DPlayer dplayer = DPlayer.get(event.getPlayer()); DPlayer dplayer = DPlayer.get(event.getPlayer());
if (dplayer != null) { if (dplayer != null) {
if (!dplayer.isEditing) { if (dplayer.isEditing && p.permission.has(event.getPlayer(), "dungeonsxl.cmdedit") || event.getPlayer().isOp()){
String[] splittedCmd = event.getMessage().split(" "); return;
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); 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);
} }
} }
} }