This commit is contained in:
Draycia committed 2020-09-09 20:45:20 -07:00
1 parent a47ff4e7b2
commit 29bdcc8061
48 files changed
+303 -307

No files matched your search

@@ -51,7 +51,7 @@ public class AliasedChannelCommand {
private void setChannel(@NonNull Player player, @NonNull Object @NonNull [] args) {
ChatUser user = carbonChat.getUserService().wrap(player);
if (user.getChannelSettings(getChatChannel()).isIgnored()) {
if (user.getChannelSettings(getChatChannel()).ignored()) {
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player, getChatChannel().getCannotUseMessage(),
"br", "\n",
"color", "<" + getChatChannel().getChannelColor(user).toString() + ">",
@@ -60,7 +60,7 @@ public class AliasedChannelCommand {
return;
}
user.setSelectedChannel(getChatChannel());
user.selectedChannel(getChatChannel());
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player, getChatChannel().getSwitchMessage(),
"br", "\n",
@@ -24,7 +24,7 @@ public class ChannelCommand {
public ChannelCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -33,9 +33,9 @@ public class ChannelCommand {
LinkedHashMap<String, Argument> setChannelArguments = new LinkedHashMap<>();
setChannelArguments.put("channel", CarbonUtils.channelArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(setChannelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channel"))
.executesPlayer(this::setChannel)
.register();
@@ -44,9 +44,9 @@ public class ChannelCommand {
sendMessageArguments.put("channel", CarbonUtils.channelArgument());
sendMessageArguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(sendMessageArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channel.message"))
.executesPlayer(this::sendMessage)
.register();
@@ -56,7 +56,7 @@ public class ChannelCommand {
ChatUser user = carbonChat.getUserService().wrap(player);
ChatChannel channel = (ChatChannel) args[0];
if (user.getChannelSettings(channel).isIgnored()) {
if (user.getChannelSettings(channel).ignored()) {
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player, channel.getCannotUseMessage(),
"br", "\n",
"color", "<" + channel.getChannelColor(user).toString() + ">",
@@ -65,7 +65,7 @@ public class ChannelCommand {
return;
}
user.setSelectedChannel(channel);
user.selectedChannel(channel);
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player, channel.getSwitchMessage(),
"br", "\n",
@@ -30,7 +30,7 @@ public class ChannelListCommand {
public ChannelListCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -38,9 +38,9 @@ public class ChannelListCommand {
LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>();
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(channelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channellist"))
.executesPlayer(this::executeSelf)
.register();
@@ -48,9 +48,9 @@ public class ChannelListCommand {
LinkedHashMap<String, Argument> argumentsOther = new LinkedHashMap<>();
argumentsOther.put("player", CarbonUtils.onlineChatUserArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(argumentsOther)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channellist.other"))
.executes(this::executeOther)
.register();
@@ -67,9 +67,9 @@ public class ChannelListCommand {
Audience cmdSender = carbonChat.getAdventureManager().getAudiences().audience(sender);
ChatUser user = (ChatUser) args[0];
if (!user.isOnline()) {
if (!user.online()) {
String mustBeOnline = carbonChat.getLanguage().getString("user-must-be-online");
cmdSender.sendMessage(carbonChat.getAdventureManager().processMessage(mustBeOnline, "br", "\n", "player", user.asOfflinePlayer().getName()));
cmdSender.sendMessage(carbonChat.getAdventureManager().processMessage(mustBeOnline, "br", "\n", "player", user.offlinePlayer().getName()));
return;
}
@@ -17,14 +17,14 @@ public class ChatReloadCommand {
public ChatReloadCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
CommandUtils.handleDuplicateCommands(commandSettings);
new CommandAPICommand(commandSettings.getName())
.withAliases(commandSettings.getAliasesArray())
new CommandAPICommand(commandSettings.name())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.reload"))
.executes(this::execute)
.register();
@@ -21,14 +21,14 @@ public class ClearChatCommand {
public ClearChatCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
CommandUtils.handleDuplicateCommands(commandSettings);
new CommandAPICommand(commandSettings.getName())
.withAliases(commandSettings.getAliasesArray())
new CommandAPICommand(commandSettings.name())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.clearchat.clear"))
.executes(this::execute)
.register();
@@ -24,7 +24,7 @@ public class IgnoreCommand {
public IgnoreCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -33,9 +33,9 @@ public class IgnoreCommand {
LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>();
channelArguments.put("player", CarbonUtils.chatUserArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(channelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.ignore"))
.executesPlayer(this::execute)
.register();
@@ -49,13 +49,13 @@ public class IgnoreCommand {
user.setIgnoringUser(targetUser, false);
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player,
carbonChat.getLanguage().getString("not-ignoring-user"),
"br", "\n", "player", targetUser.asOfflinePlayer().getName()));
"br", "\n", "player", targetUser.offlinePlayer().getName()));
} else {
Bukkit.getScheduler().runTaskAsynchronously(carbonChat, () -> {
Permission permission = carbonChat.getPermission();
String format;
if (permission.playerHas(null, targetUser.asOfflinePlayer(), "carbonchat.ignore.exempt")) {
if (permission.playerHas(null, targetUser.offlinePlayer(), "carbonchat.ignore.exempt")) {
format = carbonChat.getLanguage().getString("ignore-exempt");
} else {
user.setIgnoringUser(targetUser, true);
@@ -64,7 +64,7 @@ public class IgnoreCommand {
Component message = carbonChat.getAdventureManager().processMessageWithPapi(player, format,
"br", "\n", "sender", player.getDisplayName(), "player",
targetUser.asOfflinePlayer().getName());
targetUser.offlinePlayer().getName());
user.sendMessage(message);
});
@@ -24,7 +24,7 @@ public class MeCommand {
public MeCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -33,9 +33,9 @@ public class MeCommand {
LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>();
channelArguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(channelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.me"))
.executesPlayer(this::execute)
.register();
@@ -22,7 +22,7 @@ public class MessageCommand {
public MessageCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -32,9 +32,9 @@ public class MessageCommand {
arguments.put("player", CarbonUtils.chatUserArgument());
arguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(arguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.message"))
.executesPlayer(this::execute)
.register();
@@ -25,7 +25,7 @@ public class MuteCommand {
public MuteCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -34,9 +34,9 @@ public class MuteCommand {
LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
arguments.put("player", CarbonUtils.chatUserArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(arguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.mute"))
.executes(this::execute)
.register();
@@ -51,7 +51,7 @@ public class MuteCommand {
String format = carbonChat.getLanguage().getString("no-longer-muted");
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
"player", user.asOfflinePlayer().getName());
"player", user.offlinePlayer().getName());
audience.sendMessage(message);
} else {
@@ -59,7 +59,7 @@ public class MuteCommand {
Permission permission = carbonChat.getPermission();
String format;
if (permission.playerHas(null, user.asOfflinePlayer(), "carbonchat.mute.exempt")) {
if (permission.playerHas(null, user.offlinePlayer(), "carbonchat.mute.exempt")) {
format = carbonChat.getLanguage().getString("mute-exempt");
} else {
user.setMuted(true);
@@ -67,7 +67,7 @@ public class MuteCommand {
}
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
"player", user.asOfflinePlayer().getName());
"player", user.offlinePlayer().getName());
audience.sendMessage(message);
});
@@ -24,7 +24,7 @@ public class NicknameCommand {
public NicknameCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -33,9 +33,9 @@ public class NicknameCommand {
LinkedHashMap<String, Argument> selfArguments = new LinkedHashMap<>();
selfArguments.put("nickname", new StringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(selfArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.nickname"))
.executesPlayer(this::executeSelf)
.register();
@@ -44,9 +44,9 @@ public class NicknameCommand {
otherArguments.put("player", CarbonUtils.chatUserArgument());
otherArguments.put("nickname", new StringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(otherArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.nickname.others"))
.executes(this::executeOther)
.register();
@@ -60,7 +60,7 @@ public class NicknameCommand {
nickname = null;
}
sender.setNickname(nickname);
sender.nickname(nickname);
String message;
@@ -72,7 +72,7 @@ public class NicknameCommand {
sender.sendMessage(carbonChat.getAdventureManager().processMessage(
message, "nickname", nickname == null ? "" : nickname,
"user", sender.asOfflinePlayer().getName()));
"user", sender.offlinePlayer().getName()));
}
private void executeOther(@NonNull CommandSender sender, @NonNull Object @NonNull [] args) {
@@ -81,11 +81,11 @@ public class NicknameCommand {
String nickname = (String) args[1];
if (nickname.equalsIgnoreCase("off") ||
nickname.equalsIgnoreCase(target.asOfflinePlayer().getName())) {
nickname.equalsIgnoreCase(target.offlinePlayer().getName())) {
nickname = null;
}
target.setNickname(nickname);
target.nickname(nickname);
String message;
@@ -97,7 +97,7 @@ public class NicknameCommand {
user.sendMessage(carbonChat.getAdventureManager().processMessage(
message, "nickname", nickname == null ? "" : nickname,
"user", target.asOfflinePlayer().getName()));
"user", target.offlinePlayer().getName()));
}
}
@@ -22,7 +22,7 @@ public class ReplyCommand {
public ReplyCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -31,9 +31,9 @@ public class ReplyCommand {
LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
arguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(arguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.reply"))
.executesPlayer(this::execute)
.register();
@@ -24,7 +24,7 @@ public class SetColorCommand {
public SetColorCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -35,9 +35,9 @@ public class SetColorCommand {
arguments.put("channel", new LiteralArgument(channel.getKey()));
arguments.put("color", CarbonUtils.textColorArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(arguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.setcolor"))
.executesPlayer((player, args) -> {
TextColor color = (TextColor) args[0];
@@ -54,7 +54,7 @@ public class SetColorCommand {
UserChannelSettings settings = user.getChannelSettings(channel);
settings.setColor(color);
settings.color(color);
user.sendMessage(carbonChat.getAdventureManager().processMessageWithPapi(player,
carbonChat.getLanguage().getString("channel-color-set"),
@@ -25,7 +25,7 @@ public class ShadowMuteCommand {
public ShadowMuteCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -34,9 +34,9 @@ public class ShadowMuteCommand {
LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
arguments.put("player", CarbonUtils.chatUserArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(arguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.shadowmute"))
.executes(this::execute)
.register();
@@ -51,7 +51,7 @@ public class ShadowMuteCommand {
String format = carbonChat.getLanguage().getString("no-longer-shadow-muted");
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
"player", user.asOfflinePlayer().getName());
"player", user.offlinePlayer().getName());
audience.sendMessage(message);
} else {
@@ -59,7 +59,7 @@ public class ShadowMuteCommand {
Permission permission = carbonChat.getPermission();
String format;
if (permission.playerHas(null, user.asOfflinePlayer(), "carbonchat.shadowmute.exempt")) {
if (permission.playerHas(null, user.offlinePlayer(), "carbonchat.shadowmute.exempt")) {
format = carbonChat.getLanguage().getString("shadow-mute-exempt");
} else {
user.setShadowMuted(true);
@@ -67,7 +67,7 @@ public class ShadowMuteCommand {
}
Component message = carbonChat.getAdventureManager().processMessage(format, "br", "\n",
"player", user.asOfflinePlayer().getName());
"player", user.offlinePlayer().getName());
audience.sendMessage(message);
});
@@ -25,7 +25,7 @@ public class SpyChannelCommand {
public SpyChannelCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -34,9 +34,9 @@ public class SpyChannelCommand {
LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>();
channelArguments.put("channel", CarbonUtils.channelArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(channelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.spy"))
.executesPlayer(this::execute)
.register();
@@ -44,9 +44,9 @@ public class SpyChannelCommand {
LinkedHashMap<String, Argument> whisperArguments = new LinkedHashMap<>();
whisperArguments.put("channel", new LiteralArgument("whispers"));
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(whisperArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.spy"))
.executesPlayer(this::executeWhispers)
.register();
@@ -55,9 +55,9 @@ public class SpyChannelCommand {
everythingArguments.put("channel", new LiteralArgument("*"));
everythingArguments.put("should-spy", new BooleanArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(everythingArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.spy"))
.executesPlayer(this::executeEverything) // lul
.register();
@@ -71,11 +71,11 @@ public class SpyChannelCommand {
UserChannelSettings settings = user.getChannelSettings(chatChannel);
if (settings.isSpying()) {
settings.setSpying(false);
if (settings.spying()) {
settings.spying(false);
message = carbonChat.getLanguage().getString("spy-toggled-off");
} else {
settings.setSpying(true);
settings.spying(true);
message = carbonChat.getLanguage().getString("spy-toggled-on");
}
@@ -110,7 +110,7 @@ public class SpyChannelCommand {
user.setSpyingWhispers(true);
for (ChatChannel channel : carbonChat.getChannelManager().getRegistry().values()) {
user.getChannelSettings(channel).setSpying(true);
user.getChannelSettings(channel).spying(true);
}
message = carbonChat.getLanguage().getString("spy-everything-off");
@@ -118,7 +118,7 @@ public class SpyChannelCommand {
user.setSpyingWhispers(false);
for (ChatChannel channel : carbonChat.getChannelManager().getRegistry().values()) {
user.getChannelSettings(channel).setSpying(false);
user.getChannelSettings(channel).spying(false);
}
message = carbonChat.getLanguage().getString("spy-everything-on");
@@ -24,7 +24,7 @@ public class SudoChannelCommand {
public SudoChannelCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -34,9 +34,9 @@ public class SudoChannelCommand {
setOtherChannelArguments.put("player", CarbonUtils.onlineChatUserArgument());
setOtherChannelArguments.put("channel", CarbonUtils.channelArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(setOtherChannelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channel.others"))
.executes((sender, args) -> {
this.setOtherChannel(sender, (ChatUser) args[0], (ChatChannel) args[1]);
@@ -48,9 +48,9 @@ public class SudoChannelCommand {
sendMessageOtherArguments.put("channel", CarbonUtils.channelArgument());
sendMessageOtherArguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(sendMessageOtherArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channel.others.message"))
.executes((sender, args) -> {
this.sendMessageOther(sender, (ChatUser) args[0], (ChatChannel) args[1], (String) args[2]);
@@ -59,7 +59,7 @@ public class SudoChannelCommand {
}
private void setOtherChannel(@NonNull CommandSender sender, @NonNull ChatUser user, @NonNull ChatChannel channel) {
user.setSelectedChannel(channel);
user.selectedChannel(channel);
String message = channel.getSwitchMessage();
String otherMessage = channel.getSwitchOtherMessage();
@@ -69,7 +69,7 @@ public class SudoChannelCommand {
carbonChat.getAdventureManager().getAudiences().audience(sender).sendMessage(carbonChat.getAdventureManager().processMessage(otherMessage, "br", "\n",
"color", "<color:" + channel.getChannelColor(user).toString() + ">", "channel", channel.getName(),
"player", user.asOfflinePlayer().getName()));
"player", user.offlinePlayer().getName()));
}
private void sendMessageOther(@NonNull CommandSender sender, @NonNull ChatUser user, @NonNull ChatChannel channel, @NonNull String message) {
@@ -24,7 +24,7 @@ public class ToggleCommand {
public ToggleCommand(@NonNull CarbonChat carbonChat, @NonNull CommandSettings commandSettings) {
this.carbonChat = carbonChat;
if (!commandSettings.isEnabled()) {
if (!commandSettings.enabled()) {
return;
}
@@ -33,9 +33,9 @@ public class ToggleCommand {
LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>();
channelArguments.put("channel", CarbonUtils.channelArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(channelArguments)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.toggle"))
.executesPlayer(this::executeSelf)
.register();
@@ -44,9 +44,9 @@ public class ToggleCommand {
argumentsOther.put("players", CarbonUtils.chatUserArgument());
argumentsOther.put("channel", CarbonUtils.channelArgument());
new CommandAPICommand(commandSettings.getName())
new CommandAPICommand(commandSettings.name())
.withArguments(argumentsOther)
.withAliases(commandSettings.getAliasesArray())
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.toggle"))
.executes(this::executeOther)
.register();
@@ -62,11 +62,11 @@ public class ToggleCommand {
if (!channel.isIgnorable()) {
message = channel.getCannotIgnoreMessage();
} else if (settings.isIgnored()) {
settings.setIgnoring(false);
} else if (settings.ignored()) {
settings.ignoring(false);
message = channel.getToggleOffMessage();
} else {
settings.setIgnoring(true);
settings.ignoring(true);
message = channel.getToggleOnMessage();
}
@@ -83,12 +83,12 @@ public class ToggleCommand {
UserChannelSettings settings = user.getChannelSettings(channel);
if (settings.isIgnored()) {
settings.setIgnoring(false);
if (settings.ignored()) {
settings.ignoring(false);
message = channel.getToggleOffMessage();
otherMessage = channel.getToggleOtherOffMessage();
} else {
settings.setIgnoring(true);
settings.ignoring(true);
message = channel.getToggleOnMessage();
otherMessage = channel.getToggleOtherOnMessage();
}
@@ -98,6 +98,6 @@ public class ToggleCommand {
carbonChat.getAdventureManager().getAudiences().audience(sender).sendMessage(carbonChat.getAdventureManager().processMessage(otherMessage,
"br", "\n", "color", "<color:" + channel.getChannelColor(user).toString() + ">",
"channel", channel.getName(), "player", user.asOfflinePlayer().getName()));
"channel", channel.getName(), "player", user.offlinePlayer().getName()));
}
}