diff --git a/build-logic/src/main/kotlin/carbon.base-conventions.gradle.kts b/build-logic/src/main/kotlin/carbon.base-conventions.gradle.kts index 7262ec7f..bcd42adf 100644 --- a/build-logic/src/main/kotlin/carbon.base-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/carbon.base-conventions.gradle.kts @@ -21,6 +21,7 @@ indra { license { header.set(resources.text.fromFile(rootProject.file("LICENSE_HEADER"))) + exclude("net/draycia/carbon/common/command/argument/CarbonPlayerArgument.java") exclude("net/draycia/carbon/common/command/argument/OptionValueParser.java") exclude("net/draycia/carbon/common/messages/PrefixedDelegateIterator.java") exclude("net/draycia/carbon/common/messages/StandardPlaceholderResolverStrategyButDifferent.java") diff --git a/common/src/main/java/net/draycia/carbon/common/command/argument/CarbonPlayerArgument.java b/common/src/main/java/net/draycia/carbon/common/command/argument/CarbonPlayerArgument.java index fa2cea2d..464e7a43 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/argument/CarbonPlayerArgument.java +++ b/common/src/main/java/net/draycia/carbon/common/command/argument/CarbonPlayerArgument.java @@ -1,153 +1,240 @@ -/* - * CarbonChat - * - * Copyright (c) 2021 Josua Parks (Vicarious) - * Contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +// +// MIT License +// +// Copyright (c) 2021 Alexander Söderberg & Contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// package net.draycia.carbon.common.command.argument; +import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.captions.Caption; +import cloud.commandframework.captions.CaptionVariable; import cloud.commandframework.context.CommandContext; -import com.google.inject.Inject; +import cloud.commandframework.exceptions.parsing.NoInputProvidedException; +import cloud.commandframework.exceptions.parsing.ParserException; +import java.util.ArrayList; import java.util.List; import java.util.Queue; -import java.util.function.BiPredicate; -import net.draycia.carbon.api.CarbonServer; +import java.util.function.BiFunction; +import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; +import net.draycia.carbon.common.messages.CarbonMessageService; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.checkerframework.framework.qual.DefaultQualifier; -@DefaultQualifier(NonNull.class) -public class CarbonPlayerArgument { +/** + * Argument that parses into a {@link CarbonPlayer}. + */ +@SuppressWarnings("unused") +public final class CarbonPlayerArgument extends CommandArgument { - private final CarbonServer server; - - @Inject - public CarbonPlayerArgument(final CarbonServer server) { - this.server = server; - } - - public static final BiPredicate NO_FILTER = (sender, target) -> true; - public static final BiPredicate NO_SENDER = (sender, target) -> !sender.equals(target); - - public CommandArgument newInstance( + private CarbonPlayerArgument( final boolean required, - final String name, - final BiPredicate filter + final @NonNull String name, + final @NonNull String defaultValue, + final @Nullable BiFunction<@NonNull CommandContext, @NonNull String, + @NonNull List<@NonNull String>> suggestionsProvider, + final @NonNull ArgumentDescription defaultDescription, + final @NonNull CarbonMessageService messageService ) { - return new CarbonPlayerArgumentImpl(required, name, - new CarbonPlayerArgumentParser(this.server, filter), CarbonPlayer.class); + super(required, name, new CarbonPlayerParser(messageService), defaultValue, CarbonPlayer.class, suggestionsProvider, defaultDescription); } - public CommandArgument newInstance( - final boolean required, - final String name - ) { - return new CarbonPlayerArgumentImpl(required, name, - new CarbonPlayerArgumentParser(this.server, NO_FILTER), CarbonPlayer.class); + /** + * Create a new builder. + * + * @param name name of the component + * @return created builder + */ + public static @NonNull Builder newBuilder(final @NonNull String name) { + return new Builder(name); } - public static final class CarbonPlayerArgumentImpl extends CommandArgument { + /** + * Create a new required command component. + * + * @param name component name + * @return created component + */ + public static @NonNull CommandArgument of(final @NonNull String name) { + return CarbonPlayerArgument.newBuilder(name).asRequired().build(); + } - CarbonPlayerArgumentImpl( - final boolean required, - final String name, - final ArgumentParser parser, - final Class valueType - ) { - super(required, name, parser, valueType); + /** + * Create a new optional command component. + * + * @param name component name + * @return created component + */ + public static @NonNull CommandArgument optional(final @NonNull String name) { + return CarbonPlayerArgument.newBuilder(name).asOptional().build(); + } + + /** + * Create a new required command component with a default value. + * + * @param name component name + * @param defaultCarbonPlayer default player + * @return created component + */ + public static @NonNull CommandArgument optional( + final @NonNull String name, + final @NonNull String defaultCarbonPlayer + ) { + return CarbonPlayerArgument.newBuilder(name).asOptionalWithDefault(defaultCarbonPlayer).build(); + } + + public static final class Builder extends CommandArgument.Builder { + + private CarbonMessageService messageService; + + private Builder(final @NonNull String name) { + super(CarbonPlayer.class, name); + } + + /** + * Set the message service. + * + * @param messageService the message service + * @return builder instance + */ + public Builder withMessageService(final @NonNull CarbonMessageService messageService) { + this.messageService = messageService; + return this; + } + + /** + * Builder a new boolean component. + * + * @return constructed component + */ + @Override + public @NonNull CarbonPlayerArgument build() { + return new CarbonPlayerArgument( + this.isRequired(), + this.getName(), + this.getDefaultValue(), + this.getSuggestionsProvider(), + this.getDefaultDescription(), + this.messageService + ); } } - private static final class CarbonPlayerArgumentParser implements ArgumentParser { + public static final class CarbonPlayerParser implements ArgumentParser { - final CarbonServer server; - final BiPredicate filter; + private final @NonNull CarbonMessageService messageService; - @Inject - CarbonPlayerArgumentParser( - final CarbonServer carbonServer, - final BiPredicate filter - ) { - this.server = carbonServer; - this.filter = filter; + public CarbonPlayerParser(final @NonNull CarbonMessageService messageService) { + this.messageService = messageService; } @Override - public ArgumentParseResult parse( - final CommandContext commandContext, - final Queue inputQueue + @SuppressWarnings("deprecation") + public @NonNull ArgumentParseResult parse( + final @NonNull CommandContext commandContext, + final @NonNull Queue<@NonNull String> inputQueue ) { - final @Nullable String input = inputQueue.peek(); + final String input = inputQueue.peek(); + if (input == null) { + return ArgumentParseResult.failure(new NoInputProvidedException( + CarbonPlayerParser.class, + commandContext + )); + } + inputQueue.remove(); - for (final var player : this.server.players()) { - if (player.username().equalsIgnoreCase(input)) { - inputQueue.remove(); - return ArgumentParseResult.success(player); + final var playerResult = CarbonChatProvider.carbonChat().server().player(input).join(); + + if (playerResult.player() == null) { + return ArgumentParseResult.failure(new CarbonPlayerParseException(input, commandContext, this.messageService)); + } + + return ArgumentParseResult.success(playerResult.player()); + } + + @Override + public @NonNull List<@NonNull String> suggestions( + final @NonNull CommandContext commandContext, + final @NonNull String input + ) { + final List output = new ArrayList<>(); + + for (final CarbonPlayer player : CarbonChatProvider.carbonChat().server().players()) { + if (commandContext.getSender() instanceof PlayerCommander playerCommander) { + if (!playerCommander.carbonPlayer().awareOf(player)) { + continue; + } } + + output.add(player.username()); } - return ArgumentParseResult.failure(new PlayerParseException(input)); - } - - @Override - public List suggestions( - final CommandContext commandContext, - final String input - ) { - if (commandContext.getSender() instanceof PlayerCommander sender) { - return this.server.players().stream() - .filter(it -> this.filter.test(sender.carbonPlayer(), it)) - .filter(sender.carbonPlayer()::awareOf) - .map(CarbonPlayer::username) - .toList(); - } else { - return this.server.players().stream() - .map(CarbonPlayer::username) - .toList(); - } + return output; } } - public static final class PlayerParseException extends RuntimeException { + /** + * CarbonPlayer parse exception. + */ + public static final class CarbonPlayerParseException extends ParserException { - private static final long serialVersionUID = -8703083769083215214L; + private static final long serialVersionUID = -8331761537951077684L; private final String input; - public PlayerParseException( - final String input + /** + * Construct a new CarbonPlayer parse exception. + * + * @param input string input + * @param context command context + */ + public CarbonPlayerParseException( + final @NonNull String input, + final @NonNull CommandContext context, + final @NonNull CarbonMessageService messageService ) { + super( + CarbonPlayerParser.class, + context, + Caption.of("argument.parse.failure.player"), + CaptionVariable.of("input", input) + ); this.input = input; } - public String input() { + /** + * Get the supplied input. + * + * @return string value + */ + public @NonNull String input() { return this.input; } - @Override - public String getMessage() { - return "No player found for input: '" + this.input + "'"; - } } } diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/ClearChatCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/ClearChatCommand.java index c65994dd..629bdf21 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/ClearChatCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/ClearChatCommand.java @@ -27,6 +27,7 @@ import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.config.PrimaryConfig; +import net.draycia.carbon.common.messages.CarbonMessageService; import net.kyori.adventure.text.Component; public class ClearChatCommand { @@ -35,12 +36,13 @@ public class ClearChatCommand { public ClearChatCommand( final CarbonChat carbonChat, final CommandManager commandManager, - final PrimaryConfig config + final PrimaryConfig config, + final CarbonMessageService messageService ) { final var command = commandManager.commandBuilder("clearchat", "chatclear", "cc") .permission("carbon.clearchat.clear") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Clears the chat window for all players.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandClearChatDescription().component()) .handler(handler -> { // Not fond of having to send 50 messages to each player // Are we not able to just paste in 50 newlines and call it a day? diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/ContinueCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/ContinueCommand.java index cfc842d0..f575e596 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/ContinueCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/ContinueCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.StringArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.UUID; import net.draycia.carbon.api.CarbonChat; @@ -47,10 +47,11 @@ public class ContinueCommand { final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("continue", "c") - .argument(StringArgument.greedy("message"), ArgumentDescription.of("The message to send.")) + .argument(StringArgument.greedy("message"), + RichDescription.of(messageService.commandContinueArgumentMessage().component())) .permission("carbon.whisper.continue") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Sends a message to the last person you messaged.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandContinueDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); @@ -81,7 +82,7 @@ public class ContinueCommand { && !sender.hasPermission("carbon.whisper.vanished")) ) { final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient); - final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput); + final var exception = new CarbonPlayerArgument.CarbonPlayerParseException(rawNameInput, handler, messageService); messageService.errorCommandArgumentParsing(sender, CloudUtils.message(exception)); return; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/DebugCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/DebugCommand.java index a701cadd..787b32ee 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/DebugCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/DebugCommand.java @@ -19,15 +19,16 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.ArrayList; import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; +import net.draycia.carbon.common.messages.CarbonMessageService; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.JoinConfiguration; import net.kyori.adventure.text.format.NamedTextColor; @@ -37,14 +38,14 @@ public class DebugCommand { @Inject public DebugCommand( final CommandManager commandManager, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonMessageService messageService ) { final var command = commandManager.commandBuilder("carbondebug", "cdebug") - .argument(carbonPlayerArgument.newInstance(false, "player"), - ArgumentDescription.of("The player to check the groups of.")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandDebugArgumentPlayer().component())) .permission("carbon.debug") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Shows the permission groups of players.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandDebugDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/HelpCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/HelpCommand.java index e0cb5a90..6fdf953e 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/HelpCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/HelpCommand.java @@ -24,13 +24,13 @@ import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.StringArgument; import cloud.commandframework.context.CommandContext; import cloud.commandframework.minecraft.extras.AudienceProvider; -import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; import cloud.commandframework.minecraft.extras.MinecraftHelp; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.List; import net.draycia.carbon.common.command.Commander; +import net.draycia.carbon.common.messages.CarbonMessageService; import net.draycia.carbon.common.messages.CarbonMessageSource; -import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.template.TemplateResolver; @@ -52,19 +52,19 @@ public final class HelpCommand { @Inject public HelpCommand( final CommandManager commandManager, - final CarbonMessageSource messageSource + final CarbonMessageSource messageSource, + final CarbonMessageService messageService ) { this.manager = commandManager; this.help = createHelp(commandManager, messageSource); final var command = commandManager.commandBuilder("carbon") - .literal("help") + .literal("help", + RichDescription.of(messageService.commandHelpDescription().component())) .argument(StringArgument.newBuilder("query") - .greedy() - .withSuggestionsProvider(this::suggestQueries) - .asOptional()) + .greedy().withSuggestionsProvider(this::suggestQueries).asOptional(), + RichDescription.of(messageService.commandHelpArgumentQuery().component())) .permission("carbon.help") - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Carbon command list.")) .handler(this::execute) .build(); @@ -101,7 +101,7 @@ public final class HelpCommand { ); help.messageProvider((sender, key, args) -> { - final String messageKey = "command.help." + key; + final String messageKey = "command.help.misc." + key; final TemplateResolver resolver; // Total hack but works for now diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/IgnoreCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/IgnoreCommand.java index 74f2c1c2..5c134f11 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/IgnoreCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/IgnoreCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.UUIDArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.Objects; import java.util.UUID; @@ -32,7 +32,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.framework.qual.DefaultQualifier; @@ -43,20 +42,19 @@ public class IgnoreCommand { public IgnoreCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonChat carbonChat, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("ignore", "block") - .argument(carbonPlayerArgument.newInstance(false, "player", CarbonPlayerArgument.NO_SENDER), - ArgumentDescription.of("The name of the player to ignore.")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandIgnoreArgumentPlayer().component())) .flag(commandManager.flagBuilder("uuid") .withAliases("u") - .withDescription(ArgumentDescription.of("The UUID of the player to ignore.")) + .withDescription(RichDescription.of(messageService.commandIgnoreArgumentUUID().component())) .withArgument(UUIDArgument.optional("uuid")) ) .permission("carbon.ignore.ignore") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Hides all incoming messages from ignored players.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandIgnoreDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/MuteCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteCommand.java index 78c20ebc..fce91c8a 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/MuteCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.UUIDArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.Objects; import java.util.UUID; @@ -32,7 +32,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.framework.qual.DefaultQualifier; @@ -43,20 +42,19 @@ public class MuteCommand { public MuteCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonChat carbonChat, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("mute") - .argument(carbonPlayerArgument.newInstance(false, "player", CarbonPlayerArgument.NO_SENDER), - ArgumentDescription.of("The name of the player to mute.")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandMuteArgumentPlayer().component())) .flag(commandManager.flagBuilder("uuid") .withAliases("u") - .withDescription(ArgumentDescription.of("The UUID of the player to mute.")) + .withDescription(RichDescription.of(messageService.commandMuteArgumentUUID().component())) .withArgument(UUIDArgument.optional("uuid")) ) .permission("carbon.mute.mute") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Mutes players, preventing them from using chat or whispering other players.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandMuteDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java index a10fff90..1a91f5cd 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.UUIDArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.Objects; import java.util.UUID; @@ -32,7 +32,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.framework.qual.DefaultQualifier; @@ -43,19 +42,19 @@ public class MuteInfoCommand { public MuteInfoCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonChat carbonChat, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("muteinfo", "muted") - .argument(carbonPlayerArgument.newInstance(false, "player"), ArgumentDescription.of("The name of the player.")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandMuteInfoArgumentPlayer().component())) .flag(commandManager.flagBuilder("uuid") .withAliases("u") - .withDescription(ArgumentDescription.of("The UUID of the player.")) + .withDescription(RichDescription.of(messageService.commandMuteInfoArgumentUUID().component())) .withArgument(UUIDArgument.optional("uuid")) ) .permission("carbon.mute.info") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Shows if players are muted or not.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandMuteInfoDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/NicknameCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/NicknameCommand.java index 08ee317b..5b8a0098 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/NicknameCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/NicknameCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.compound.FlagArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import cloud.commandframework.permission.Permission; import com.google.inject.Inject; import net.draycia.carbon.api.users.CarbonPlayer; @@ -31,7 +31,6 @@ import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.command.argument.OptionValueParser; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; @@ -40,19 +39,19 @@ public class NicknameCommand { @Inject public NicknameCommand( final CommandManager commandManager, - final CarbonMessageService messageService, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonMessageService messageService ) { final var command = commandManager.commandBuilder("nickname", "nick") + // TODO: Allow UUID input for target player .flag(commandManager.flagBuilder("player") .withAliases("p") - .withDescription(ArgumentDescription.of("The name of the target player. Without this flag, the sender is the target.")) - .withArgument(carbonPlayerArgument.newInstance(true, "recipient")) + .withDescription(RichDescription.of(messageService.commandNicknameArgumentPlayer().component())) + .withArgument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional()) .withPermission(Permission.of("carbon.nickname.others")) ) .flag(commandManager.flagBuilder("nickname") .withAliases("n") - .withDescription(ArgumentDescription.of("The nickname to set.")) + .withDescription(RichDescription.of(messageService.commandNicknameArgumentNickname().component())) .withArgument(FlagArgument.ofType(String.class, "value") .withParser(new OptionValueParser<>()) .asOptional() @@ -61,12 +60,12 @@ public class NicknameCommand { ) .flag(commandManager.flagBuilder("reset") .withAliases("r") - .withDescription(ArgumentDescription.of("Removes any set nickname from the player.")) + .withDescription(RichDescription.of(messageService.commandNicknameArgumentReset().component())) .withPermission(Permission.of("carbon.nickname.set")) ) .permission("carbon.nickname") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Sets and shows player nicknames.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandNicknameDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/ReloadCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/ReloadCommand.java index 0f6624ae..cb72f8b2 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/ReloadCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/ReloadCommand.java @@ -27,7 +27,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.config.ConfigFactory; import net.draycia.carbon.common.config.PrimaryConfig; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.framework.qual.DefaultQualifier; @@ -45,7 +44,7 @@ public class ReloadCommand { final var command = commandManager.commandBuilder("creload", "carbonreload") .permission("carbon.reload") .senderType(Commander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Reloads carbon's config, channel settings, and translations. Will not load or unload any channels.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandReloadDescription().component()) .handler(handler -> { channelRegistry.reloadRegisteredConfigChannels(); diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/ReplyCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/ReplyCommand.java index 64d7dfc5..6058290b 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/ReplyCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/ReplyCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.StringArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.UUID; import net.draycia.carbon.api.CarbonChat; @@ -50,10 +50,11 @@ public class ReplyCommand { final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("reply", "r") - .argument(StringArgument.greedy("message"), ArgumentDescription.of("The message to reply with.")) + .argument(StringArgument.greedy("message"), + RichDescription.of(messageService.commandReplyArgumentMessage().component())) .permission("carbon.whisper.reply") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Sends a message to the last player that messaged you.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandReplyDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); @@ -83,7 +84,7 @@ public class ReplyCommand { && !sender.hasPermission("carbon.whisper.vanished")) ) { final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient); - final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput); + final var exception = new CarbonPlayerArgument.CarbonPlayerParseException(rawNameInput, handler, messageService); messageService.errorCommandArgumentParsing(sender, CloudUtils.message(exception)); return; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/UnignoreCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/UnignoreCommand.java index 54730d3e..c91279fc 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/UnignoreCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/UnignoreCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.UUIDArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.Objects; import java.util.UUID; @@ -32,7 +32,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.framework.qual.DefaultQualifier; @@ -43,21 +42,20 @@ public class UnignoreCommand { public UnignoreCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonChat carbonChat, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonChat carbonChat ) { final var command = commandManager.commandBuilder("unignore", "unblock") // TODO: Filter, and only show muted players, but allow inputting any player name. - .argument(carbonPlayerArgument.newInstance(false, "player"), - ArgumentDescription.of("The name of the player to unignore.")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandUnignoreArgumentPlayer().component())) .flag(commandManager.flagBuilder("uuid") .withAliases("u") - .withDescription(ArgumentDescription.of("The UUID of the player to unignore.")) + .withDescription(RichDescription.of(messageService.commandUnignoreArgumentUUID().component())) .withArgument(UUIDArgument.optional("uuid")) ) .permission("carbon.ignore.unignore") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Stops hiding messages from the specified player.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandUnignoreDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/UnmuteCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/UnmuteCommand.java index 3a3e8d94..0b4933b3 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/UnmuteCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/UnmuteCommand.java @@ -19,10 +19,10 @@ */ package net.draycia.carbon.common.command.commands; -import cloud.commandframework.ArgumentDescription; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.UUIDArgument; import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import java.util.Objects; import java.util.UUID; @@ -32,7 +32,6 @@ import net.draycia.carbon.common.command.Commander; import net.draycia.carbon.common.command.PlayerCommander; import net.draycia.carbon.common.command.argument.CarbonPlayerArgument; import net.draycia.carbon.common.messages.CarbonMessageService; -import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.framework.qual.DefaultQualifier; @@ -43,21 +42,19 @@ public class UnmuteCommand { public UnmuteCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonChat carbonChat, - final CarbonPlayerArgument carbonPlayerArgument + final CarbonChat carbonChat ) { - final var command = commandManager.commandBuilder("unmute", - ArgumentDescription.of("The name of the player to unmute.")) - .argument(carbonPlayerArgument.newInstance(false, "player", - CarbonPlayerArgument.NO_SENDER.and((sender, player) -> player.muted()))) + final var command = commandManager.commandBuilder("unmute") + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asOptional(), + RichDescription.of(messageService.commandUnmuteArgumentPlayer().component())) .flag(commandManager.flagBuilder("uuid") .withAliases("u") - .withDescription(ArgumentDescription.of("The UUID of the player to unmute.")) + .withDescription(RichDescription.of(messageService.commandUnmuteArgumentUUID().component())) .withArgument(UUIDArgument.optional("uuid")) ) .permission("carbon.mute.unmute") .senderType(PlayerCommander.class) - .meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Unmutes players, allowing them to use chat and whisper other players.")) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandUnmuteDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); final CarbonPlayer target; diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/WhisperCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/WhisperCommand.java index 0a3c898c..6b969cea 100644 --- a/common/src/main/java/net/draycia/carbon/common/command/commands/WhisperCommand.java +++ b/common/src/main/java/net/draycia/carbon/common/command/commands/WhisperCommand.java @@ -21,6 +21,8 @@ package net.draycia.carbon.common.command.commands; import cloud.commandframework.CommandManager; import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys; +import cloud.commandframework.minecraft.extras.RichDescription; import com.google.inject.Inject; import net.draycia.carbon.api.CarbonServer; import net.draycia.carbon.api.users.CarbonPlayer; @@ -38,14 +40,16 @@ public class WhisperCommand { public WhisperCommand( final CommandManager commandManager, final CarbonMessageService messageService, - final CarbonPlayerArgument carbonPlayerArgument, final CarbonServer carbonServer ) { final var command = commandManager.commandBuilder("whisper", "w", "message", "msg") - .argument(carbonPlayerArgument.newInstance(true, "recipient", CarbonPlayerArgument.NO_SENDER)) - .argument(StringArgument.greedy("message")) + .argument(CarbonPlayerArgument.newBuilder("player").withMessageService(messageService).asRequired(), + RichDescription.of(messageService.commandWhisperArgumentPlayer().component())) + .argument(StringArgument.greedy("message"), + RichDescription.of(messageService.commandWhisperArgumentMessage().component())) .permission("carbon.whisper.message") .senderType(PlayerCommander.class) + .meta(MinecraftExtrasMetaKeys.DESCRIPTION, messageService.commandWhisperDescription().component()) .handler(handler -> { final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer(); @@ -55,7 +59,7 @@ public class WhisperCommand { } final String message = handler.get("message"); - final CarbonPlayer recipient = handler.get("recipient"); + final CarbonPlayer recipient = handler.get("player"); if (sender.equals(recipient)) { messageService.whisperSelfError(sender, CarbonPlayer.renderName(sender)); @@ -67,7 +71,7 @@ public class WhisperCommand { && !sender.hasPermission("carbon.whisper.vanished")) ) { final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient); - final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput); + final var exception = new CarbonPlayerArgument.CarbonPlayerParseException(rawNameInput, handler, messageService); messageService.errorCommandArgumentParsing(sender, CloudUtils.message(exception)); return; diff --git a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java index 6fb5af9c..9b385487 100644 --- a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java +++ b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java @@ -230,10 +230,115 @@ public interface CarbonMessageService { @Message("error.command.argument_parsing") void errorCommandArgumentParsing(final Audience audience, @Placeholder("throwable_message") final Component throwableMessage); + @Message("error.command.invalid_player") + RenderedMessage errorCommandInvalidPlayer(final Audience audience, final String input); + @Message("error.command.invalid_sender") void errorCommandInvalidSender(final Audience audience, final String sender_type); @Message("error.command.invalid_syntax") void errorCommandInvalidSyntax(final Audience audience, final Component syntax); + /* + * ============================================================= + * =================== Command Documentation =================== + * ============================================================= + */ + + @Message("command.clearchat.description") + RenderedMessage commandClearChatDescription(); + + @Message("command.continue.argument.message") + RenderedMessage commandContinueArgumentMessage(); + + @Message("command.continue.description") + RenderedMessage commandContinueDescription(); + + @Message("command.debug.argument.player") + RenderedMessage commandDebugArgumentPlayer(); + + @Message("command.debug.description") + RenderedMessage commandDebugDescription(); + + @Message("command.help.argument.query") + RenderedMessage commandHelpArgumentQuery(); + + @Message("command.help.description") + RenderedMessage commandHelpDescription(); + + @Message("command.ignore.argument.player") + RenderedMessage commandIgnoreArgumentPlayer(); + + @Message("command.ignore.argument.uuid") + RenderedMessage commandIgnoreArgumentUUID(); + + @Message("command.ignore.description") + RenderedMessage commandIgnoreDescription(); + + @Message("command.mute.argument.player") + RenderedMessage commandMuteArgumentPlayer(); + + @Message("command.mute.argument.uuid") + RenderedMessage commandMuteArgumentUUID(); + + @Message("command.mute.description") + RenderedMessage commandMuteDescription(); + + @Message("command.muteinfo.argument.player") + RenderedMessage commandMuteInfoArgumentPlayer(); + + @Message("command.muteinfo.argument.uuid") + RenderedMessage commandMuteInfoArgumentUUID(); + + @Message("command.muteinfo.description") + RenderedMessage commandMuteInfoDescription(); + + @Message("command.nickname.argument.player") + RenderedMessage commandNicknameArgumentPlayer(); + + @Message("command.nickname.argument.nickname") + RenderedMessage commandNicknameArgumentNickname(); + + @Message("command.nickname.argument.reset") + RenderedMessage commandNicknameArgumentReset(); + + @Message("command.nickname.description") + RenderedMessage commandNicknameDescription(); + + @Message("command.reload.description") + RenderedMessage commandReloadDescription(); + + @Message("command.reply.argument.message") + RenderedMessage commandReplyArgumentMessage(); + + @Message("command.reply.description") + RenderedMessage commandReplyDescription(); + + @Message("command.unignore.argument.player") + RenderedMessage commandUnignoreArgumentPlayer(); + + @Message("command.unignore.argument.uuid") + RenderedMessage commandUnignoreArgumentUUID(); + + @Message("command.unignore.description") + RenderedMessage commandUnignoreDescription(); + + @Message("command.unmute.argument.player") + RenderedMessage commandUnmuteArgumentPlayer(); + + @Message("command.unmute.argument.uuid") + RenderedMessage commandUnmuteArgumentUUID(); + + @Message("command.unmute.description") + RenderedMessage commandUnmuteDescription(); + + @Message("command.whisper.argument.player") + RenderedMessage commandWhisperArgumentPlayer(); + + @Message("command.whisper.argument.message") + RenderedMessage commandWhisperArgumentMessage(); + + @Message("command.whisper.description") + RenderedMessage commandWhisperDescription(); + } diff --git a/common/src/main/java/net/draycia/carbon/common/messages/Recipient.java b/common/src/main/java/net/draycia/carbon/common/messages/Recipient.java deleted file mode 100644 index 5044910d..00000000 --- a/common/src/main/java/net/draycia/carbon/common/messages/Recipient.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CarbonChat - * - * Copyright (c) 2021 Josua Parks (Vicarious) - * Contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package net.draycia.carbon.common.messages; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker for a message recipient for detection with {@link ReceiverResolver}. - */ -@Documented -@Target({ElementType.PARAMETER, ElementType.TYPE_USE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Recipient { - -} diff --git a/common/src/main/resources/locale/messages-en_US.properties b/common/src/main/resources/locale/messages-en_US.properties index b5b01785..11468e38 100644 --- a/common/src/main/resources/locale/messages-en_US.properties +++ b/common/src/main/resources/locale/messages-en_US.properties @@ -1,22 +1,55 @@ channel.change=You are now messaging channel.format.basic=\: -command.help.arguments=Arguments -command.help.available_commands=Available Commands -command.help.click_for_next_page=Click for next page -command.help.click_for_previous_page=Click for previous page -command.help.click_to_show_help=Click to show help for this command -command.help.command=Command -command.help.description=Description -command.help.help=Help -command.help.no_description=No description -command.help.no_results_for_query=No results for query -command.help.optional=Optional -command.help.page_out_of_range=Error: Page is not in range. Must be in range [1, ] -command.help.showing_results_for_query=Showing search results for query +command.clearchat.description=Clears the chat window for all players. +command.continue.argument.message=The message to send. +command.continue.description=Sends a message to the last person you messaged. +command.debug.argument.player=The player to check the groups of. +command.debug.description=Shows the permission groups of players. +command.help.argument.query=The search query. +command.help.description=Carbon command list. +command.help.misc.arguments=Arguments +command.help.misc.available_commands=Available Commands +command.help.misc.click_for_next_page=Click for next page +command.help.misc.click_for_previous_page=Click for previous page +command.help.misc.click_to_show_help=Click to show help for this command +command.help.misc.command=Command +command.help.misc.description=Description +command.help.misc.help=Help +command.help.misc.no_description=No description +command.help.misc.no_results_for_query=No results for query +command.help.misc.optional=Optional +command.help.misc.page_out_of_range=Error: Page is not in range. Must be in range [1, ] +command.help.misc.showing_results_for_query=Showing search results for query +command.ignore.argument.player=The name of the player to ignore. +command.ignore.argument.uuid=The UUID of the player to ignore. +command.ignore.description=Hides all incoming messages from ignored players. +command.mute.argument.player=The name of the player to mute. +command.mute.argument.uuid=The UUID of the player to mute. +command.mute.description=Mutes players, preventing them from using chat or whispering other players. +command.muteinfo.argument.player=The name of the player. +command.muteinfo.argument.uuid=The UUID of the player. +command.muteinfo.description=Shows if players are muted or not. +command.nickname.argument.nickname=The nickname to set. +command.nickname.argument.player=The name of the target player. Without this flag, the sender is the target. +command.nickname.argument.reset=Removes any set nickname from the target. +command.nickname.description=Sets and shows player nicknames. +command.reload.description=Reloads carbon's config, channel settings, and translations. Will not load or unload any channels. +command.reply.argument.message=The message to reply with. +command.reply.description=Sends a message to the last player that messaged you. +command.unignore.argument.player=The name of the player to unignore. +command.unignore.argument.uuid=The UUID of the player to unignore. +command.unignore.description=Stops hiding messages from the specified player. +command.unmute.argument.player=The name of the player to unmute. +command.unmute.argument.uuid=The UUID of the player to unmute. +command.unmute.description=Unmutes players, allowing them to use chat and whisper other players. +command.whisper.argument.message=The message to send. +command.whisper.argument.player=The name of the player to message. +command.whisper.description=Sends a private message to the specified player. config.reload.failed=Config failed to reload config.reload.success=Config reloaded successfully error.command.argument_parsing=Invalid command argument: error.command.command_execution=\n\n Click to copy">>An internal error occurred while attempting to perform this command. +error.command.invalid_player=No player found for input '' error.command.invalid_sender=Invalid command sender. You must be of type error.command.invalid_syntax=Invalid command syntax. Correct command syntax is: / error.command.no_permission=I'm sorry, but you do not have permission to perform this command.\nPlease contact the server administrators if you believe that this is in error. @@ -39,8 +72,8 @@ mute.unmute.alert.target=You have been unmuted mute.unmute.no_target=No specified player to unmute. nickname.reset.others='s nickname was reset nickname.reset=Your nickname was reset -nickname.set.others=You set 's nickname to nickname.see.self.error=You cannot see your own nickname +nickname.set.others=You set 's nickname to nickname.set=Your nickname has been set to nickname.show.others.unset= does not have a nickname set nickname.show.others='s nickname is