mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
more progress
This commit is contained in:
1 parent
29bdcc8061
commit
9f496be5f3
66 files changed
+1179
-1153
No files matched your search
@@ -22,7 +22,7 @@ public class MuteCommand {
|
||||
@NonNull
|
||||
private final CarbonChat carbonChat;
|
||||
|
||||
public MuteCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
|
||||
public MuteCommand(@NonNull final CarbonChat carbonChat, @NonNull final CommandSettings commandSettings) {
|
||||
this.carbonChat = carbonChat;
|
||||
|
||||
if (!commandSettings.enabled()) {
|
||||
@@ -31,7 +31,7 @@ public class MuteCommand {
|
||||
|
||||
CommandUtils.handleDuplicateCommands(commandSettings);
|
||||
|
||||
LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
|
||||
final LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
|
||||
arguments.put("player", CarbonUtils.chatUserArgument());
|
||||
|
||||
new CommandAPICommand(commandSettings.name())
|
||||
@@ -42,31 +42,31 @@ public class MuteCommand {
|
||||
.register();
|
||||
}
|
||||
|
||||
private void execute(@NonNull CommandSender sender, @NonNull Object @NonNull [] args) {
|
||||
ChatUser user = (ChatUser) args[0];
|
||||
Audience audience = carbonChat.getAdventureManager().getAudiences().audience(sender);
|
||||
private void execute(@NonNull final CommandSender sender, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = (ChatUser) args[0];
|
||||
final Audience audience = this.carbonChat.getAdventureManager().audiences().audience(sender);
|
||||
|
||||
if (user.isShadowMuted()) {
|
||||
user.setMuted(false);
|
||||
String format = carbonChat.getLanguage().getString("no-longer-muted");
|
||||
if (user.shadowMuted()) {
|
||||
user.muted(false);
|
||||
final String format = this.carbonChat.getLanguage().getString("no-longer-muted");
|
||||
|
||||
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(carbonChat, () -> {
|
||||
Permission permission = carbonChat.getPermission();
|
||||
String format;
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.carbonChat, () -> {
|
||||
final Permission permission = this.carbonChat.getPermission();
|
||||
final String format;
|
||||
|
||||
if (permission.playerHas(null, user.offlinePlayer(), "carbonchat.mute.exempt")) {
|
||||
format = carbonChat.getLanguage().getString("mute-exempt");
|
||||
format = this.carbonChat.getLanguage().getString("mute-exempt");
|
||||
} else {
|
||||
user.setMuted(true);
|
||||
format = carbonChat.getLanguage().getString("is-now-muted");
|
||||
user.muted(true);
|
||||
format = this.carbonChat.getLanguage().getString("is-now-muted");
|
||||
}
|
||||
|
||||
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
|
||||
Reference in new issue
Block a user