mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Remove flags automatically when permission is removed.
This commit is contained in:
parent
f60b8cad33
commit
de894c721c
@ -200,6 +200,20 @@ public class MineverseChatPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isListening(String channel) {
|
public boolean isListening(String channel) {
|
||||||
|
if(this.isOnline()) {
|
||||||
|
if(ChatChannel.isChannel(channel)) {
|
||||||
|
ChatChannel chatChannel = ChatChannel.getChannel(channel);
|
||||||
|
if(chatChannel.hasPermission()) {
|
||||||
|
if(!this.getPlayer().hasPermission(chatChannel.getPermission())) {
|
||||||
|
if(this.getCurrentChannel().equals(chatChannel)) {
|
||||||
|
this.setCurrentChannel(ChatChannel.getDefaultChannel());
|
||||||
|
}
|
||||||
|
this.removeListening(channel);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.listening.contains(channel);
|
return this.listening.contains(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +364,12 @@ public class MineverseChatPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSpy() {
|
public boolean isSpy() {
|
||||||
|
if(this.isOnline()) {
|
||||||
|
if(!this.getPlayer().hasPermission("venturechat.spy")) {
|
||||||
|
this.setSpy(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.spy;
|
return this.spy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,6 +378,12 @@ public class MineverseChatPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasCommandSpy() {
|
public boolean hasCommandSpy() {
|
||||||
|
if(this.isOnline()) {
|
||||||
|
if(!this.getPlayer().hasPermission("venturechat.commandspy")) {
|
||||||
|
this.setCommandSpy(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.commandSpy;
|
return this.commandSpy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user