mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
Finish style fixes
This commit is contained in:
1 parent
9f496be5f3
commit
c68b92dc62
44 files changed
+623
-620
No files matched your search
@@ -49,10 +49,10 @@ public class AliasedChannelCommand {
|
||||
}
|
||||
|
||||
private void channel(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (user.channelSettings(this.chatChannel()).ignored()) {
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, this.chatChannel().cannotUseMessage(),
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, this.chatChannel().cannotUseMessage(),
|
||||
"br", "\n",
|
||||
"color", "<" + this.chatChannel().channelColor(user).toString() + ">",
|
||||
"channel", this.chatChannel().name()));
|
||||
@@ -62,19 +62,19 @@ public class AliasedChannelCommand {
|
||||
|
||||
user.selectedChannel(this.chatChannel());
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, this.chatChannel().switchMessage(),
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, this.chatChannel().switchMessage(),
|
||||
"br", "\n",
|
||||
"color", "<" + this.chatChannel().channelColor(user).toString() + ">",
|
||||
"channel", this.chatChannel().name()));
|
||||
}
|
||||
|
||||
private void sendMessage(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
final String message = (String) args[0];
|
||||
|
||||
final Component component = this.chatChannel().sendMessage(user, message, false);
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().console().sendMessage(component);
|
||||
this.carbonChat.adventureManager().audiences().console().sendMessage(component);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -53,11 +53,11 @@ public class ChannelCommand {
|
||||
}
|
||||
|
||||
private void channel(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
final ChatChannel channel = (ChatChannel) args[0];
|
||||
|
||||
if (user.channelSettings(channel).ignored()) {
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, channel.cannotUseMessage(),
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, channel.cannotUseMessage(),
|
||||
"br", "\n",
|
||||
"color", "<" + channel.channelColor(user).toString() + ">",
|
||||
"channel", channel.name()));
|
||||
@@ -67,20 +67,20 @@ public class ChannelCommand {
|
||||
|
||||
user.selectedChannel(channel);
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, channel.switchMessage(),
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, channel.switchMessage(),
|
||||
"br", "\n",
|
||||
"color", "<" + channel.channelColor(user).toString() + ">",
|
||||
"channel", channel.name()));
|
||||
}
|
||||
|
||||
private void sendMessage(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
final ChatChannel channel = (ChatChannel) args[0];
|
||||
final String message = (String) args[1];
|
||||
|
||||
final Component component = channel.sendMessage(user, message, false);
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().console().sendMessage(component);
|
||||
this.carbonChat.adventureManager().audiences().console().sendMessage(component);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,23 +57,23 @@ public class ChannelListCommand {
|
||||
}
|
||||
|
||||
public void executeSelf(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final Iterator<ChatChannel> allChannels = this.carbonChat.getChannelManager().registry().values().iterator();
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final Iterator<ChatChannel> allChannels = this.carbonChat.channelManager().registry().values().iterator();
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
this.listAndSend(player, user, allChannels);
|
||||
}
|
||||
|
||||
public void executeOther(@NonNull final CommandSender sender, @NonNull final Object @NonNull [] args) {
|
||||
final Audience cmdSender = this.carbonChat.getAdventureManager().audiences().audience(sender);
|
||||
final Audience cmdSender = this.carbonChat.adventureManager().audiences().audience(sender);
|
||||
final ChatUser user = (ChatUser) args[0];
|
||||
|
||||
if (!user.online()) {
|
||||
final String mustBeOnline = this.carbonChat.getLanguage().getString("user-must-be-online");
|
||||
cmdSender.sendMessage(this.carbonChat.getAdventureManager().processMessage(mustBeOnline, "br", "\n", "player", user.offlinePlayer().getName()));
|
||||
final String mustBeOnline = this.carbonChat.language().getString("user-must-be-online");
|
||||
cmdSender.sendMessage(this.carbonChat.adventureManager().processMessage(mustBeOnline, "br", "\n", "player", user.offlinePlayer().getName()));
|
||||
return;
|
||||
}
|
||||
|
||||
final Iterator<ChatChannel> allChannels = this.carbonChat.getChannelManager().registry().values().iterator();
|
||||
final Iterator<ChatChannel> allChannels = this.carbonChat.channelManager().registry().values().iterator();
|
||||
this.listAndSend(sender, user, allChannels);
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ public class ChannelListCommand {
|
||||
|
||||
this.makeList(visibleChannels, availableList);
|
||||
|
||||
final String availableFormat = this.carbonChat.getLanguage().getString("available-channels-list");
|
||||
Component availableComponent = this.carbonChat.getAdventureManager().processMessage(availableFormat, "br", "\n");
|
||||
final String availableFormat = this.carbonChat.language().getString("available-channels-list");
|
||||
Component availableComponent = this.carbonChat.adventureManager().processMessage(availableFormat, "br", "\n");
|
||||
availableComponent = availableComponent.replaceFirstText(Pattern.compile(Pattern.quote("<list>")), ac -> availableList);
|
||||
|
||||
final Audience audience = this.carbonChat.getAdventureManager().audiences().audience(sender);
|
||||
final Audience audience = this.carbonChat.adventureManager().audiences().audience(sender);
|
||||
|
||||
audience.sendMessage(availableComponent);
|
||||
|
||||
@@ -112,8 +112,8 @@ public class ChannelListCommand {
|
||||
|
||||
this.makeList(invisibleChannels, unavailableList);
|
||||
|
||||
final String unavailableFormat = this.carbonChat.getLanguage().getString("unavailable-channels-list");
|
||||
Component unavailableComponent = this.carbonChat.getAdventureManager().processMessage(unavailableFormat, "br", "\n");
|
||||
final String unavailableFormat = this.carbonChat.language().getString("unavailable-channels-list");
|
||||
Component unavailableComponent = this.carbonChat.adventureManager().processMessage(unavailableFormat, "br", "\n");
|
||||
unavailableComponent = unavailableComponent.replaceFirstText(Pattern.compile(Pattern.quote("<list>")), uac -> unavailableList);
|
||||
|
||||
audience.sendMessage(unavailableComponent);
|
||||
@@ -121,7 +121,7 @@ public class ChannelListCommand {
|
||||
}
|
||||
|
||||
private void makeList(@NonNull final Iterator<@NonNull ChatChannel> iterator, final TextComponent.@NonNull Builder list) {
|
||||
final String listSeparator = this.carbonChat.getLanguage().getString("channel-list-separator", ", ");
|
||||
final String listSeparator = this.carbonChat.language().getString("channel-list-separator", ", ");
|
||||
// TODO: Larry, why did you double assign the listSeparatorComponent?
|
||||
final Component listSeparatorComponent = TextComponent.of(listSeparator);
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ public class ChatReloadCommand {
|
||||
this.carbonChat.reloadConfig();
|
||||
this.carbonChat.reloadFilters();
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager()
|
||||
.processMessage(this.carbonChat.getLanguage().getString("reloaded"), "br", "\n");
|
||||
final Component message = this.carbonChat.adventureManager()
|
||||
.processMessage(this.carbonChat.language().getString("reloaded"), "br", "\n");
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().audience(sender).sendMessage(message);
|
||||
this.carbonChat.adventureManager().audiences().audience(sender).sendMessage(message);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,24 +34,24 @@ public class ClearChatCommand {
|
||||
}
|
||||
|
||||
private void execute(@NonNull final CommandSender sender, @NonNull final Object @NonNull [] args) {
|
||||
final String format = this.carbonChat.getModConfig().getString("clear-chat.message", "");
|
||||
final Component component = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n");
|
||||
final String format = this.carbonChat.moderationConfig().getString("clear-chat.message", "");
|
||||
final Component component = this.carbonChat.adventureManager().processMessage(format, "br", "\n");
|
||||
|
||||
for (final Player player : Bukkit.getOnlinePlayers()) {
|
||||
final ChatUser audience = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser audience = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (player.hasPermission("carbonchat.clearchat.exempt")) {
|
||||
final String message = this.carbonChat.getLanguage().getString("clear-exempt");
|
||||
audience.sendMessage(this.carbonChat.getAdventureManager().processMessage(message, "player", sender.getName()));
|
||||
final String message = this.carbonChat.language().getString("clear-exempt");
|
||||
audience.sendMessage(this.carbonChat.adventureManager().processMessage(message, "player", sender.getName()));
|
||||
} else {
|
||||
for (int i = 0; i < this.carbonChat.getModConfig().getInt("clear-chat.message-count", 100); i++) {
|
||||
for (int i = 0; i < this.carbonChat.moderationConfig().getInt("clear-chat.message-count", 100); i++) {
|
||||
audience.sendMessage(component);
|
||||
}
|
||||
}
|
||||
|
||||
if (player.hasPermission("carbonchat.clearchat.notify")) {
|
||||
final String message = this.carbonChat.getLanguage().getString("clear-notify");
|
||||
audience.sendMessage(this.carbonChat.getAdventureManager().processMessage(message, "player", sender.getName()));
|
||||
final String message = this.carbonChat.language().getString("clear-notify");
|
||||
audience.sendMessage(this.carbonChat.adventureManager().processMessage(message, "player", sender.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,26 +43,26 @@ public class IgnoreCommand {
|
||||
|
||||
private void execute(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser targetUser = (ChatUser) args[0];
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (user.ignoringUser(targetUser)) {
|
||||
user.ignoringUser(targetUser, false);
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.getLanguage().getString("not-ignoring-user"),
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.language().getString("not-ignoring-user"),
|
||||
"br", "\n", "player", targetUser.offlinePlayer().getName()));
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.carbonChat, () -> {
|
||||
final Permission permission = this.carbonChat.getPermission();
|
||||
final Permission permission = this.carbonChat.permission();
|
||||
final String format;
|
||||
|
||||
if (permission.playerHas(null, targetUser.offlinePlayer(), "carbonchat.ignore.exempt")) {
|
||||
format = this.carbonChat.getLanguage().getString("ignore-exempt");
|
||||
format = this.carbonChat.language().getString("ignore-exempt");
|
||||
} else {
|
||||
user.ignoringUser(targetUser, true);
|
||||
format = this.carbonChat.getLanguage().getString("ignoring-user");
|
||||
format = this.carbonChat.language().getString("ignoring-user");
|
||||
}
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessageWithPapi(player, format,
|
||||
final Component message = this.carbonChat.adventureManager().processMessageWithPapi(player, format,
|
||||
"br", "\n", "sender", player.getDisplayName(), "player",
|
||||
targetUser.offlinePlayer().getName());
|
||||
|
||||
|
||||
@@ -43,26 +43,26 @@ public class MeCommand {
|
||||
|
||||
private void execute(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final String message = ((String) args[0]).replace("</pre>", "");
|
||||
String format = PlaceholderAPI.setPlaceholders(player, this.carbonChat.getLanguage().getString("me"));
|
||||
String format = PlaceholderAPI.setPlaceholders(player, this.carbonChat.language().getString("me"));
|
||||
|
||||
if (!player.hasPermission("carbonchat.me.formatting")) {
|
||||
format = format.replace("<message>", "<pre><message></pre>");
|
||||
}
|
||||
|
||||
final Component component = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component component = this.carbonChat.adventureManager().processMessage(format, "br", "\n",
|
||||
"displayname", player.getDisplayName(), "message", message);
|
||||
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (user.shadowMuted()) {
|
||||
user.sendMessage(component);
|
||||
} else {
|
||||
for (final Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
if (this.carbonChat.getUserService().wrap(onlinePlayer).ignoringUser(user)) {
|
||||
if (this.carbonChat.userService().wrap(onlinePlayer).ignoringUser(user)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().player(onlinePlayer).sendMessage(component);
|
||||
this.carbonChat.adventureManager().audiences().player(onlinePlayer).sendMessage(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class MessageCommand {
|
||||
final ChatUser targetUser = (ChatUser) args[0];
|
||||
final String message = (String) args[1];
|
||||
|
||||
final ChatUser sender = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser sender = this.carbonChat.userService().wrap(player);
|
||||
|
||||
targetUser.sendMessage(sender, message);
|
||||
}
|
||||
|
||||
@@ -44,29 +44,29 @@ public class MuteCommand {
|
||||
|
||||
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);
|
||||
final Audience audience = this.carbonChat.adventureManager().audiences().audience(sender);
|
||||
|
||||
if (user.shadowMuted()) {
|
||||
user.muted(false);
|
||||
final String format = this.carbonChat.getLanguage().getString("no-longer-muted");
|
||||
final String format = this.carbonChat.language().getString("no-longer-muted");
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.adventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.carbonChat, () -> {
|
||||
final Permission permission = this.carbonChat.getPermission();
|
||||
final Permission permission = this.carbonChat.permission();
|
||||
final String format;
|
||||
|
||||
if (permission.playerHas(null, user.offlinePlayer(), "carbonchat.mute.exempt")) {
|
||||
format = this.carbonChat.getLanguage().getString("mute-exempt");
|
||||
format = this.carbonChat.language().getString("mute-exempt");
|
||||
} else {
|
||||
user.muted(true);
|
||||
format = this.carbonChat.getLanguage().getString("is-now-muted");
|
||||
format = this.carbonChat.language().getString("is-now-muted");
|
||||
}
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.adventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class NicknameCommand {
|
||||
|
||||
private void executeSelf(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
String nickname = (String) args[0];
|
||||
final ChatUser sender = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser sender = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (nickname.equalsIgnoreCase("off") || nickname.equalsIgnoreCase(player.getName())) {
|
||||
nickname = null;
|
||||
@@ -65,18 +65,18 @@ public class NicknameCommand {
|
||||
final String message;
|
||||
|
||||
if (nickname == null) {
|
||||
message = this.carbonChat.getLanguage().getString("nickname-reset");
|
||||
message = this.carbonChat.language().getString("nickname-reset");
|
||||
} else {
|
||||
message = this.carbonChat.getLanguage().getString("nickname-set");
|
||||
message = this.carbonChat.language().getString("nickname-set");
|
||||
}
|
||||
|
||||
sender.sendMessage(this.carbonChat.getAdventureManager().processMessage(
|
||||
sender.sendMessage(this.carbonChat.adventureManager().processMessage(
|
||||
message, "nickname", nickname == null ? "" : nickname,
|
||||
"user", sender.offlinePlayer().getName()));
|
||||
}
|
||||
|
||||
private void executeOther(@NonNull final CommandSender sender, @NonNull final Object @NonNull [] args) {
|
||||
final Audience user = this.carbonChat.getAdventureManager().audiences().audience(sender);
|
||||
final Audience user = this.carbonChat.adventureManager().audiences().audience(sender);
|
||||
final ChatUser target = (ChatUser) args[0];
|
||||
String nickname = (String) args[1];
|
||||
|
||||
@@ -90,12 +90,12 @@ public class NicknameCommand {
|
||||
final String message;
|
||||
|
||||
if (nickname == null) {
|
||||
message = this.carbonChat.getLanguage().getString("other-nickname-reset");
|
||||
message = this.carbonChat.language().getString("other-nickname-reset");
|
||||
} else {
|
||||
message = this.carbonChat.getLanguage().getString("other-nickname-set");
|
||||
message = this.carbonChat.language().getString("other-nickname-set");
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessage(
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessage(
|
||||
message, "nickname", nickname == null ? "" : nickname,
|
||||
"user", target.offlinePlayer().getName()));
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ public class ReplyCommand {
|
||||
private void execute(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final String input = (String) args[0];
|
||||
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (input.isEmpty()) {
|
||||
final String message = this.carbonChat.getLanguage().getString("reply-message-blank");
|
||||
final Component component = this.carbonChat.getAdventureManager().processMessage(message, "br", "\n");
|
||||
final String message = this.carbonChat.language().getString("reply-message-blank");
|
||||
final Component component = this.carbonChat.adventureManager().processMessage(message, "br", "\n");
|
||||
|
||||
user.sendMessage(component);
|
||||
|
||||
@@ -54,15 +54,15 @@ public class ReplyCommand {
|
||||
}
|
||||
|
||||
if (user.replyTarget() == null) {
|
||||
final String message = this.carbonChat.getLanguage().getString("no-reply-target");
|
||||
final Component component = this.carbonChat.getAdventureManager().processMessage(message, "br", "\n");
|
||||
final String message = this.carbonChat.language().getString("no-reply-target");
|
||||
final Component component = this.carbonChat.adventureManager().processMessage(message, "br", "\n");
|
||||
|
||||
user.sendMessage(component);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
final ChatUser targetUser = this.carbonChat.getUserService().wrap(user.replyTarget());
|
||||
final ChatUser targetUser = this.carbonChat.userService().wrap(user.replyTarget());
|
||||
|
||||
targetUser.sendMessage(user, input);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SetColorCommand {
|
||||
|
||||
CommandUtils.handleDuplicateCommands(commandSettings);
|
||||
|
||||
for (final ChatChannel channel : this.carbonChat.getChannelManager().registry().values()) {
|
||||
for (final ChatChannel channel : this.carbonChat.channelManager().registry().values()) {
|
||||
final LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
|
||||
arguments.put("channel", new LiteralArgument(channel.key()));
|
||||
arguments.put("color", CarbonUtils.textColorArgument());
|
||||
@@ -41,11 +41,11 @@ public class SetColorCommand {
|
||||
.withPermission(CommandPermission.fromString("carbonchat.setcolor"))
|
||||
.executesPlayer((player, args) -> {
|
||||
final TextColor color = (TextColor) args[0];
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
if (!player.hasPermission("carbonchat.setcolor." + channel.key())) {
|
||||
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.getLanguage().getString("cannot-set-color"),
|
||||
user.sendMessage(carbonChat.adventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.language().getString("cannot-set-color"),
|
||||
"br", "\n", "input", color.asHexString(),
|
||||
"channel", channel.name()));
|
||||
|
||||
@@ -56,8 +56,8 @@ public class SetColorCommand {
|
||||
|
||||
settings.color(color);
|
||||
|
||||
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.getLanguage().getString("channel-color-set"),
|
||||
user.sendMessage(carbonChat.adventureManager().processMessageWithPapi(player,
|
||||
this.carbonChat.language().getString("channel-color-set"),
|
||||
"br", "\n", "color", "<color:" + color.asHexString() + ">", "channel",
|
||||
channel.name(), "hex", color.asHexString()));
|
||||
})
|
||||
|
||||
@@ -44,29 +44,29 @@ public class ShadowMuteCommand {
|
||||
|
||||
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);
|
||||
final Audience audience = this.carbonChat.adventureManager().audiences().audience(sender);
|
||||
|
||||
if (user.shadowMuted()) {
|
||||
user.shadowMuted(false);
|
||||
final String format = this.carbonChat.getLanguage().getString("no-longer-shadow-muted");
|
||||
final String format = this.carbonChat.language().getString("no-longer-shadow-muted");
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.adventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.carbonChat, () -> {
|
||||
final Permission permission = this.carbonChat.getPermission();
|
||||
final Permission permission = this.carbonChat.permission();
|
||||
final String format;
|
||||
|
||||
if (permission.playerHas(null, user.offlinePlayer(), "carbonchat.shadowmute.exempt")) {
|
||||
format = this.carbonChat.getLanguage().getString("shadow-mute-exempt");
|
||||
format = this.carbonChat.language().getString("shadow-mute-exempt");
|
||||
} else {
|
||||
user.shadowMuted(true);
|
||||
format = this.carbonChat.getLanguage().getString("is-now-shadow-muted");
|
||||
format = this.carbonChat.language().getString("is-now-shadow-muted");
|
||||
}
|
||||
|
||||
final Component message = this.carbonChat.getAdventureManager().processMessage(format, "br", "\n",
|
||||
final Component message = this.carbonChat.adventureManager().processMessage(format, "br", "\n",
|
||||
"player", user.offlinePlayer().getName());
|
||||
|
||||
audience.sendMessage(message);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SpyChannelCommand {
|
||||
|
||||
private void execute(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatChannel chatChannel = (ChatChannel) args[0];
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
final String message;
|
||||
|
||||
@@ -73,58 +73,58 @@ public class SpyChannelCommand {
|
||||
|
||||
if (settings.spying()) {
|
||||
settings.spying(false);
|
||||
message = this.carbonChat.getLanguage().getString("spy-toggled-off");
|
||||
message = this.carbonChat.language().getString("spy-toggled-off");
|
||||
} else {
|
||||
settings.spying(true);
|
||||
message = this.carbonChat.getLanguage().getString("spy-toggled-on");
|
||||
message = this.carbonChat.language().getString("spy-toggled-on");
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||
"color", "<color:" + chatChannel.channelColor(user).toString() + ">", "channel", chatChannel.name()));
|
||||
}
|
||||
|
||||
private void executeWhispers(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
final String message;
|
||||
|
||||
if (user.spyingwhispers()) {
|
||||
user.spyingWhispers(false);
|
||||
message = this.carbonChat.getLanguage().getString("spy-whispers-off");
|
||||
message = this.carbonChat.language().getString("spy-whispers-off");
|
||||
} else {
|
||||
user.spyingWhispers(true);
|
||||
message = this.carbonChat.getLanguage().getString("spy-whispers-on");
|
||||
message = this.carbonChat.language().getString("spy-whispers-on");
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||
}
|
||||
|
||||
private void executeEverything(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final Boolean shouldSpy = (Boolean) args[0];
|
||||
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
|
||||
final String message;
|
||||
|
||||
if (shouldSpy) {
|
||||
user.spyingWhispers(true);
|
||||
|
||||
for (final ChatChannel channel : this.carbonChat.getChannelManager().registry().values()) {
|
||||
for (final ChatChannel channel : this.carbonChat.channelManager().registry().values()) {
|
||||
user.channelSettings(channel).spying(true);
|
||||
}
|
||||
|
||||
message = this.carbonChat.getLanguage().getString("spy-everything-off");
|
||||
message = this.carbonChat.language().getString("spy-everything-off");
|
||||
} else {
|
||||
user.spyingWhispers(false);
|
||||
|
||||
for (final ChatChannel channel : this.carbonChat.getChannelManager().registry().values()) {
|
||||
for (final ChatChannel channel : this.carbonChat.channelManager().registry().values()) {
|
||||
user.channelSettings(channel).spying(false);
|
||||
}
|
||||
|
||||
message = this.carbonChat.getLanguage().getString("spy-everything-on");
|
||||
message = this.carbonChat.language().getString("spy-everything-on");
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,11 +64,11 @@ public class SudoChannelCommand {
|
||||
final String message = channel.switchMessage();
|
||||
final String otherMessage = channel.switchOtherMessage();
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessage(message, "br", "\n",
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessage(message, "br", "\n",
|
||||
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name()));
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().audience(sender).sendMessage(
|
||||
this.carbonChat.getAdventureManager().processMessage(otherMessage, "br", "\n",
|
||||
this.carbonChat.adventureManager().audiences().audience(sender).sendMessage(
|
||||
this.carbonChat.adventureManager().processMessage(otherMessage, "br", "\n",
|
||||
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name(),
|
||||
"player", user.offlinePlayer().getName()));
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class SudoChannelCommand {
|
||||
@NonNull final ChatChannel channel, @NonNull final String message) {
|
||||
final Component component = channel.sendMessage(user, message, false);
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().console().sendMessage(component);
|
||||
this.carbonChat.adventureManager().audiences().console().sendMessage(component);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class ToggleCommand {
|
||||
}
|
||||
|
||||
private void executeSelf(@NonNull final Player player, @NonNull final Object @NonNull [] args) {
|
||||
final ChatUser user = this.carbonChat.getUserService().wrap(player);
|
||||
final ChatUser user = this.carbonChat.userService().wrap(player);
|
||||
final ChatChannel channel = (ChatChannel) args[0];
|
||||
|
||||
final String message;
|
||||
@@ -70,7 +70,7 @@ public class ToggleCommand {
|
||||
message = channel.toggleOnMessage();
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name()));
|
||||
}
|
||||
|
||||
@@ -93,11 +93,11 @@ public class ToggleCommand {
|
||||
otherMessage = channel.toggleOtherOnMessage();
|
||||
}
|
||||
|
||||
user.sendMessage(this.carbonChat.getAdventureManager().processMessage(message, "br", "\n",
|
||||
user.sendMessage(this.carbonChat.adventureManager().processMessage(message, "br", "\n",
|
||||
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name()));
|
||||
|
||||
this.carbonChat.getAdventureManager().audiences().audience(sender).sendMessage(
|
||||
this.carbonChat.getAdventureManager().processMessage(otherMessage,
|
||||
this.carbonChat.adventureManager().audiences().audience(sender).sendMessage(
|
||||
this.carbonChat.adventureManager().processMessage(otherMessage,
|
||||
"br", "\n", "color", "<color:" + channel.channelColor(user).toString() + ">",
|
||||
"channel", channel.name(), "player", user.offlinePlayer().getName()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user