mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Add ignore checks manually
This commit is contained in:
1 parent
ad857e326a
commit
5082a4c1bc
2 files changed
+9
No files matched your search
@@ -32,6 +32,10 @@ public class AliasedChannelCommand extends BaseCommand {
|
||||
throw new ConditionFailedException(chatChannel.getCannotUseMessage());
|
||||
}
|
||||
|
||||
if (user.getChannelSettings(chatChannel).isIgnored()) {
|
||||
throw new ConditionFailedException(chatChannel.getCannotUseMessage());
|
||||
}
|
||||
|
||||
if (args == null || args.length == 0) {
|
||||
user.setSelectedChannel(getChatChannel());
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.draycia.carbon.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.ConditionFailedException;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.draycia.carbon.CarbonChat;
|
||||
import net.draycia.carbon.channels.ChatChannel;
|
||||
@@ -23,6 +24,10 @@ public class ChannelCommand extends BaseCommand {
|
||||
public void baseCommand(Player player, @Conditions("canuse:true") ChatChannel channel, @Optional String[] args) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
if (user.getChannelSettings(channel).isIgnored()) {
|
||||
throw new ConditionFailedException(channel.getCannotUseMessage());
|
||||
}
|
||||
|
||||
if (args == null || args.length == 0) {
|
||||
user.setSelectedChannel(channel);
|
||||
|
||||
|
||||
Reference in new issue
Block a user