mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Add ClearChat messages
This commit is contained in:
1 parent
f32c515136
commit
6ca2b9c4c8
2 files changed
+15
-1
No files matched your search
@@ -13,7 +13,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandAlias("clearchat|cc")
|
||||
@CommandPermission("simplechat.clearchat")
|
||||
@CommandPermission("simplechat.clearchat.clear")
|
||||
public class ClearChatCommand extends BaseCommand {
|
||||
|
||||
private SimpleChat simpleChat;
|
||||
@@ -37,6 +37,18 @@ public class ClearChatCommand extends BaseCommand {
|
||||
for (int i = 0; i < simpleChat.getConfig().getInt("clear-chat-amount", 100); i++) {
|
||||
audience.sendMessage(component);
|
||||
}
|
||||
|
||||
String name = issuer.isPlayer() ? ((Player)issuer).getName() : "Console";
|
||||
|
||||
if (player.hasPermission("simplechat.clearchat.notify")) {
|
||||
String message = simpleChat.getConfig().getString("language.clear-notify");
|
||||
audience.sendMessage(MiniMessage.get().parse(message, "player", name));
|
||||
}
|
||||
|
||||
if (player.hasPermission("simplechat.clearchat.exempt")) {
|
||||
String message = simpleChat.getConfig().getString("language.clear-exempt");
|
||||
audience.sendMessage(MiniMessage.get().parse(message, "player", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ language:
|
||||
channel-color-set: "<green>You have set <color><channel> <green>color to <hex>!"
|
||||
spy-toggled-on: '<gray>You are now spying on <color><channel> <gray>chat!'
|
||||
spy-toggled-off: '<gray>You are no longer spying on <color><channel> <gray>chat!'
|
||||
clear-notify: '<yellow>Chat has been cleared by <player>.'
|
||||
clear-exempt: '<yellow>You were exempt from the clear due to your permissions!'
|
||||
# The following messages are not MiniMessage compatible
|
||||
player-left: '%player_displayname% has left <server>!'
|
||||
player-joined: '%player_displayname% has joined <server>!'
|
||||
|
||||
Reference in new issue
Block a user