Added new permission 'venturechat.commandspy.hide'

This commit is contained in:
Aust1n46 2020-03-03 19:41:24 -05:00
parent 8bd020359e
commit afdc0bb323

View File

@ -53,6 +53,7 @@ public class CommandListener implements CommandExecutor, Listener {
ConfigurationSection cs = plugin.getConfig().getConfigurationSection("commandspy"); ConfigurationSection cs = plugin.getConfig().getConfigurationSection("commandspy");
Boolean wec = cs.getBoolean("worldeditcommands", true); Boolean wec = cs.getBoolean("worldeditcommands", true);
MineverseChatPlayer mcp = MineverseChatAPI.getOnlineMineverseChatPlayer(event.getPlayer()); MineverseChatPlayer mcp = MineverseChatAPI.getOnlineMineverseChatPlayer(event.getPlayer());
if(!mcp.getPlayer().hasPermission("venturechat.commandspy.hide")) {
for(MineverseChatPlayer p : MineverseChat.onlinePlayers) { for(MineverseChatPlayer p : MineverseChat.onlinePlayers) {
if(p.hasCommandSpy()) { if(p.hasCommandSpy()) {
if(wec) { if(wec) {
@ -65,6 +66,7 @@ public class CommandListener implements CommandExecutor, Listener {
} }
} }
} }
}
if(!event.getMessage().startsWith("/afk")) { if(!event.getMessage().startsWith("/afk")) {
if(mcp.isAFK()) { if(mcp.isAFK()) {