mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
won't list unavailable channels if none + optimize imports
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -15,7 +15,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
|||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyFormat;
|
import net.kyori.adventure.text.serializer.legacy.LegacyFormat;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import net.kyori.adventure.text.Component;
|
|||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ public class ChannelListCommand extends BaseCommand {
|
|||||||
|
|
||||||
carbonChat.getUserService().wrap(player).sendMessage(availableComponent);
|
carbonChat.getUserService().wrap(player).sendMessage(availableComponent);
|
||||||
|
|
||||||
if (player.hasPermission("carbonchat.channellist.bypass")) {
|
if (player.hasPermission("carbonchat.channellist.bypass") && !cannotSee.isEmpty()) {
|
||||||
|
|
||||||
Iterator<ChatChannel> invisibleChannels = cannotSee.iterator();
|
Iterator<ChatChannel> invisibleChannels = cannotSee.iterator();
|
||||||
TextComponent.Builder unavailableList = TextComponent.builder("");
|
TextComponent.Builder unavailableList = TextComponent.builder("");
|
||||||
|
|||||||
Reference in new issue
Block a user