Added chatclear command
This commit is contained in:
parent
2c0637b1d1
commit
08a695f2ac
|
|
@ -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()) {
|
||||
|
|
|
|||
21
galaxy/src/main/java/com/alttd/chat/commands/ChatClear.java
Normal file
21
galaxy/src/main/java/com/alttd/chat/commands/ChatClear.java
Normal 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue
Block a user