mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Allow staff to change other players channel
This commit is contained in:
1 parent
976ff99c85
commit
e2dd63fa01
4 files changed
+26
-18
No files matched your search
@@ -5,6 +5,7 @@ import co.aikar.commands.annotation.*;
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.channels.ChatChannel;
|
||||
import net.draycia.simplechat.storage.ChatUser;
|
||||
import net.draycia.simplechat.storage.UserChannelSettings;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -38,4 +39,21 @@ public class ChannelCommand extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandPermission("simplechat.switch.others")
|
||||
@Subcommand("other")
|
||||
@CommandCompletion("@chatchannel @players")
|
||||
public void baseCommand(Player player, ChatChannel channel, ChatUser user) {
|
||||
user.setSelectedChannel(channel);
|
||||
|
||||
String message = channel.getSwitchMessage();
|
||||
String otherMessage = channel.getSwitchOtherMessage();
|
||||
|
||||
user.sendMessage(MiniMessage.get().parse(message, "br", "\n",
|
||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
||||
|
||||
simpleChat.getUserService().wrap(player).sendMessage(MiniMessage.get().parse(otherMessage, "br", "\n",
|
||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName(),
|
||||
"player", user.asOfflinePlayer().getName()));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user