mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
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:
parent
e1e94f5bfe
commit
780145cf78
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user