Add channel registry and remove custom channels

This commit is contained in:
Draycia committed 2020-07-13 07:05:50 -07:00
1 parent bbeaa3bb85
commit dceb47e160
19 files changed
+200 -565

No files matched your search

@@ -5,10 +5,6 @@ import co.aikar.commands.ConditionFailedException;
import co.aikar.commands.annotation.*;
import net.draycia.simplechat.SimpleChat;
import net.draycia.simplechat.channels.ChatChannel;
import net.draycia.simplechat.channels.impls.AllianceChatChannel;
import net.draycia.simplechat.channels.impls.NationChatChannel;
import net.draycia.simplechat.channels.impls.PartyChatChannel;
import net.draycia.simplechat.channels.impls.TownChatChannel;
import net.draycia.simplechat.storage.ChatUser;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -30,17 +26,7 @@ public class AliasedChannelCommand extends BaseCommand {
ChatUser user = simpleChat.getUserService().wrap(player);
if (!chatChannel.canPlayerUse(user)) {
if (chatChannel.isTownChat() && !((TownChatChannel)chatChannel).isInTown(user)) {
throw new ConditionFailedException(simpleChat.getConfig().getString("language.town-cannot-use"));
} else if (chatChannel.isNationChat() && !((NationChatChannel)chatChannel).isInNation(user)) {
throw new ConditionFailedException(simpleChat.getConfig().getString("language.nation-cannot-use"));
} else if (chatChannel.isAllianceChat() && !((AllianceChatChannel)chatChannel).isInNation(user)) {
throw new ConditionFailedException(simpleChat.getConfig().getString("alliance-cannot-use"));
} else if (chatChannel.isPartyChat() && !((PartyChatChannel)chatChannel).isInParty(user)) {
throw new ConditionFailedException(simpleChat.getConfig().getString("party-cannot-use"));
} else {
throw new ConditionFailedException(simpleChat.getConfig().getString("cannot-use-channel"));
}
throw new ConditionFailedException(chatChannel.getCannotUseMessage());
}
if (args == null || args.length == 0) {