Added chatclear command

This commit is contained in:
Teriuihi 2022-02-06 03:31:07 +01:00
parent 2c0637b1d1
commit 08a695f2ac
3 changed files with 25 additions and 1 deletions

View File

@ -49,6 +49,7 @@ public class ChatPlugin extends JavaPlugin {
registerCommand("unignore", new Unignore());
registerCommand("muteserver", new MuteServer());
registerCommand("spy", new Spy());
registerCommand("chatclear", new ChatClear());
// registerCommand("chatparty", new ChatParty());
registerCommand("p", new PartyChat());
for (Channel channel : Channel.getChannels()) {

View File

@ -0,0 +1,21 @@
package com.alttd.chat.commands;
import com.alttd.chat.util.Utility;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class ChatClear implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!sender.hasPermission("chat.command.clear-chat")) {
sender.sendMessage(Utility.parseMiniMessage("<red>You don't have permission to use this command.</red>"));
return true;
}
Bukkit.getServer().sendMessage(MiniMessage.miniMessage().deserialize("\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n"));
return true;
}
}

View File

@ -28,4 +28,6 @@ commands:
spy:
permission: command.chat.togglespy
p:
permission: command.chat.p
permission: command.chat.p
chatclear:
permission: chat.command.clear-chat