diff --git a/commandapi-core/src/main/java/dev/jorel/commandapi/executors/CommandArguments.java b/commandapi-core/src/main/java/dev/jorel/commandapi/executors/CommandArguments.java index c10f3686e3..2705d516b3 100644 --- a/commandapi-core/src/main/java/dev/jorel/commandapi/executors/CommandArguments.java +++ b/commandapi-core/src/main/java/dev/jorel/commandapi/executors/CommandArguments.java @@ -62,17 +62,6 @@ public Map rawArgsMap() { return Collections.unmodifiableMap(rawArgsMap); } - /** - * This returns the raw command string a player has entered - * - * @deprecated This method has been deprecated in favour of {@link CommandArguments#fullInput()} - * @return The raw command string a player has entered - */ - @Deprecated(since = "9.1.0", forRemoval = true) - public String getFullInput() { - return fullInput; - } - /** * @return The number of arguments for this command */ diff --git a/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt b/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt index 77d0ab5be7..02b980572e 100644 --- a/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt +++ b/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt @@ -8,8 +8,6 @@ import org.bukkit.command.CommandSender import java.util.function.Predicate inline fun commandAPICommand(name: String, command: CommandAPICommand.() -> Unit = {}) = CommandAPICommand(name).apply(command).register() -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun commandAPICommand(name: String, predicate: Predicate, command: CommandAPICommand.() -> Unit = {}) = CommandAPICommand(name).withRequirement(predicate).apply(command).register() inline fun CommandAPICommand.argument(base: Argument<*>, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(base.apply(block)) inline fun CommandAPICommand.arguments(vararg arguments: Argument<*>): CommandAPICommand = withArguments(*arguments) @@ -111,16 +109,7 @@ inline fun CommandAPICommand.nbtCompoundArgument(nodeName: String inline fun CommandAPICommand.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun CommandAPICommand.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandAPICommand.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandAPICommand.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun CommandAPICommand.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) // Function arguments inline fun CommandAPICommand.functionArgument(nodeName: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(FunctionArgument(nodeName).setOptional(optional).apply(block)) - -// Requirements -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun CommandAPICommand.requirement(base: Argument<*>, predicate: Predicate, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(base.setOptional(optional).withRequirement(predicate).apply(block)) diff --git a/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt b/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt index a954e4d2e4..92751d4b63 100644 --- a/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt +++ b/commandapi-kotlin/commandapi-bukkit-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt @@ -6,8 +6,6 @@ import org.bukkit.command.CommandSender import java.util.function.Predicate inline fun commandTree(name: String, tree: CommandTree.() -> Unit = {}) = CommandTree(name).apply(tree).register() -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun commandTree(name: String, predicate: Predicate, tree: CommandTree.() -> Unit = {}) = CommandTree(name).withRequirement(predicate).apply(tree).register() // CommandTree start inline fun CommandTree.argument(base: Argument<*>, block: Argument<*>.() -> Unit = {}): CommandTree = then(base.apply(block)) @@ -104,11 +102,6 @@ inline fun CommandTree.nbtCompoundArgument(nodeName: String, opti inline fun CommandTree.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun CommandTree.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandTree.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandTree.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun CommandTree.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) // Function arguments @@ -209,17 +202,7 @@ inline fun Argument<*>.nbtCompoundArgument(nodeName: String, opti inline fun Argument<*>.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun Argument<*>.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun Argument<*>.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun Argument<*>.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun Argument<*>.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) // Function arguments inline fun Argument<*>.functionArgument(nodeName: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(FunctionArgument(nodeName).setOptional(optional).apply(block)) - -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun CommandTree.requirement(base: Argument<*>, predicate: Predicate, block: Argument<*>.() -> Unit = {}): CommandTree = then(base.withRequirement(predicate).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun Argument<*>.requirement(base: Argument<*>, predicate: Predicate, block: Argument<*>.() -> Unit = {}): Argument<*> = then(base.withRequirement(predicate).apply(block)) diff --git a/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt b/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt index dd40b189b5..ef088a8c7c 100644 --- a/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt +++ b/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandAPICommandDSL.kt @@ -8,8 +8,6 @@ import dev.jorel.commandapi.arguments.* import java.util.function.Predicate inline fun commandAPICommand(name: String, command: CommandAPICommand.() -> Unit = {}) = CommandAPICommand(name).apply(command).register() -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun commandAPICommand(name: String, predicate: Predicate, command: CommandAPICommand.() -> Unit = {}) = CommandAPICommand(name).withRequirement(predicate).apply(command).register() inline fun CommandAPICommand.argument(base: Argument<*>, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(base.apply(block)) inline fun CommandAPICommand.arguments(vararg arguments: Argument<*>): CommandAPICommand = withArguments(*arguments) @@ -45,13 +43,4 @@ inline fun CommandAPICommand.greedyStringArgument(nodeName: String, optional: Bo inline fun CommandAPICommand.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun CommandAPICommand.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandAPICommand.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandAPICommand.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun CommandAPICommand.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) - -// Requirements -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun CommandAPICommand.requirement(base: Argument<*>, predicate: Predicate, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandAPICommand = withArguments(base.setOptional(optional).withRequirement(predicate).apply(block)) diff --git a/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt b/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt index 4b971f307b..f31e3402e2 100644 --- a/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt +++ b/commandapi-kotlin/commandapi-velocity-kotlin/src/main/kotlin/dev/jorel/commandapi/kotlindsl/CommandTreeDSL.kt @@ -6,8 +6,6 @@ import dev.jorel.commandapi.arguments.* import java.util.function.Predicate inline fun commandTree(name: String, tree: CommandTree.() -> Unit = {}) = CommandTree(name).apply(tree).register() -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun commandTree(name: String, predicate: Predicate, tree: CommandTree.() -> Unit = {}) = CommandTree(name).withRequirement(predicate).apply(tree).register() // CommandTree start inline fun CommandTree.argument(base: Argument<*>, block: Argument<*>.() -> Unit = {}): CommandTree = then(base.apply(block)) @@ -38,11 +36,6 @@ inline fun CommandTree.greedyStringArgument(nodeName: String, optional: Boolean inline fun CommandTree.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun CommandTree.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandTree.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun CommandTree.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun CommandTree.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): CommandTree= then(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) @@ -75,14 +68,4 @@ inline fun Argument<*>.greedyStringArgument(nodeName: String, optional: Boolean inline fun Argument<*>.literalArgument(literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(LiteralArgument.of(literal, literal).setOptional(optional).apply(block)) inline fun Argument<*>.literalArgument(nodeName: String, literal: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(LiteralArgument.of(nodeName, literal).setOptional(optional).apply(block)) -@Deprecated("This version has been deprecated since version 9.0.2", ReplaceWith("multiLiteralArgument(nodeName, listOf(literals))", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun Argument<*>.multiLiteralArgument(vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(literals).setOptional(optional).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0", ReplaceWith("multiLiteralArgument(nodeName, literals)", "dev.jorel.commandapi.kotlindsl.*"), DeprecationLevel.WARNING) -inline fun Argument<*>.multiLiteralArgument(nodeName: String, literals: List, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(nodeName, literals).setOptional(optional).apply(block)) - inline fun Argument<*>.multiLiteralArgument(nodeName: String, vararg literals: String, optional: Boolean = false, block: Argument<*>.() -> Unit = {}): Argument<*> = then(MultiLiteralArgument(nodeName, *literals).setOptional(optional).apply(block)) - -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun CommandTree.requirement(base: Argument<*>, predicate: Predicate, block: Argument<*>.() -> Unit = {}): CommandTree = then(base.withRequirement(predicate).apply(block)) -@Deprecated("This method has been deprecated since version 9.1.0 as it is not needed anymore. See the documentation for more information", ReplaceWith(""), DeprecationLevel.WARNING) -inline fun Argument<*>.requirement(base: Argument<*>, predicate: Predicate, block: Argument<*>.() -> Unit = {}): Argument<*> = then(base.withRequirement(predicate).apply(block)) diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/BukkitTooltip.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/BukkitTooltip.java index 7b5500746d..6283b8f734 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/BukkitTooltip.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/BukkitTooltip.java @@ -75,24 +75,6 @@ public static Collection> generateBaseComponents(Function} objects from an array of suggestions, and a function which generates a - * tooltip formatted as an adventure {@link Component} for each suggestion - * - * @param the object that the argument suggestions use - * @param tooltipGenerator function which returns a formatted tooltip for the suggestion, an adventure {@link Component} - * @param suggestions array of suggestions to provide to the user - * - * @deprecated This method has been deprecated in favour of {@link BukkitTooltip#generateAdventureComponents(Function, Object[])} - * @return a collection of {@link Tooltip } objects from the provided suggestions, with the generated formatted - * tooltips - */ - @Deprecated(forRemoval = true, since = "9.3.0") - @SafeVarargs - public static Collection> generateAdvenureComponents(Function tooltipGenerator, S... suggestions) { - return generate(tooltipGenerator, BukkitTooltip::ofAdventureComponent, suggestions); - } - /** * Constructs a collection of {@link Tooltip } objects from an array of suggestions, and a function which generates a * tooltip formatted as an adventure {@link Component} for each suggestion @@ -109,23 +91,6 @@ public static Collection> generateAdventureComponents(Function} objects from a collection of suggestions, and a function which generates a - * tooltip formatted as an adventure {@link Component} for each suggestion - * - * @param the object that the argument suggestions use - * @param tooltipGenerator function which returns a formatted tooltip for the suggestion, an adventure {@link Component} - * @param suggestions collection of suggestions to provide to the user - * - * @deprecated This method has been deprecated in favour of {@link BukkitTooltip#generateAdventureComponents(Function, Collection)} - * @return a collection of {@link Tooltip } objects from the provided suggestions, with the generated formatted - * tooltips - */ - @Deprecated(forRemoval = true, since = "9.3.0") - public static Collection> generateAdvenureComponents(Function tooltipGenerator, Collection suggestions) { - return generate(tooltipGenerator, BukkitTooltip::ofAdventureComponent, suggestions); - } - /** * Constructs a collection of {@link Tooltip } objects from a collection of suggestions, and a function which generates a * tooltip formatted as an adventure {@link Component} for each suggestion diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/CustomArgument.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/CustomArgument.java index 330d82117d..8881ebf810 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/CustomArgument.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/CustomArgument.java @@ -230,42 +230,6 @@ private CustomArgumentException() { } - /** - * Constructs a CustomArgumentException with a given error message - * - * @param errorMessage the error message to display to the user when this - * exception is thrown - * @deprecated Use {@link CustomArgumentException#fromBaseComponents(BaseComponent...)} instead - */ - @Deprecated(since = "9.0.1", forRemoval = true) - public CustomArgumentException(BaseComponent[] errorMessage) { - this.errorBaseComponent = errorMessage; - } - - /** - * Constructs a CustomArgumentException with a given error message - * - * @param errorMessage the error message to display to the user when this - * exception is thrown - * @deprecated Use {@link CustomArgumentException#fromString(String)} instead - */ - @Deprecated(since = "9.0.1", forRemoval = true) - public CustomArgumentException(String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * Constructs a CustomArgumentException with a given error message - * - * @param errorMessage the error message to display to the user when this - * exception is thrown - * @deprecated Use {@link CustomArgumentException#fromMessageBuilder(MessageBuilder)} instead - */ - @Deprecated(since = "9.0.1", forRemoval = true) - public CustomArgumentException(MessageBuilder errorMessage) { - this.errorMessageBuilder = errorMessage; - } - /** * Constructs a CustomArgumentException with a given error message * diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java index eeea5b5ec1..376540d5dc 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java @@ -53,28 +53,6 @@ public MultiLiteralArgument(String nodeName, String... literals) { this.literals = literals; } - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.0.2", forRemoval = true) - public MultiLiteralArgument(final String[] literals) { - this(null, literals); - } - - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * - * @param nodeName the node name for this argument - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.1.0", forRemoval = true) - public MultiLiteralArgument(String nodeName, final List literals) { - this(nodeName, literals.toArray(new String[0])); - } - @Override public Class getPrimitiveType() { return String.class; diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/TestBase.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/TestBase.java index 08e8ee7b05..c16b25ec67 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/TestBase.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/TestBase.java @@ -112,12 +112,6 @@ public void assertStoresResult(CommandSender sender, String command, Mut ); } - @Deprecated - public void assertInvalidSyntax(CommandSender sender, String command) { - // XXX: Bogus code, do not use. Use assertCommandFailsWith instead. - assertThrows(CommandSyntaxException.class, () -> assertTrue(server.dispatchThrowableCommand(sender, command))); - } - public T assertThrowsWithMessage(Class expectedType, String message, Executable executable) { T thrown = assertThrows(expectedType, executable); assertEquals(message, thrown.getMessage()); diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentCustomTests.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentCustomTests.java index b74b7e7e11..bf8eb49a33 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentCustomTests.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentCustomTests.java @@ -155,7 +155,7 @@ void instantiationTestWithLiteralCustomArgument() { }); // MultiLiteralArgument - MultiLiteralArgument multiLiteralArgument = new MultiLiteralArgument("node", List.of("hello", "world")); + MultiLiteralArgument multiLiteralArgument = new MultiLiteralArgument("node", "hello", "world"); assertThrows(IllegalArgumentException.class, () -> { new CustomArgument<>(multiLiteralArgument, info -> 1); diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentMultiLiteralTests.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentMultiLiteralTests.java index 16b6f7e71f..663da51201 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentMultiLiteralTests.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentMultiLiteralTests.java @@ -464,7 +464,7 @@ void executionTestWithArrayConstructor() { Mut results = Mut.of(); new CommandAPICommand("test") - .withArguments(new MultiLiteralArgument(new String[]{"lit1", "lit2", "lit3"})) + .withArguments(new MultiLiteralArgument("literals", "lit1", "lit2", "lit3")) .executesPlayer(info -> { results.set((String) info.args().get(0)); }) diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentTests.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentTests.java index c476b14705..c59f1de123 100644 --- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentTests.java +++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-tests/src/test/java/dev/jorel/commandapi/test/arguments/ArgumentTests.java @@ -117,8 +117,8 @@ void executionTestWithStringArgument() { assertEquals("success Hello_world", player.nextMessage()); // Negative tests from the documentation - assertInvalidSyntax(player, "test hello@email.com"); - assertInvalidSyntax(player, "test yesn't"); + assertCommandFailsWith(player, "test hello@email.com", "Expected whitespace to end one argument, but found trailing data at position 10: test hello<--[HERE]"); + assertCommandFailsWith(player, "test yesn't", "Expected whitespace to end one argument, but found trailing data at position 9: test yesn<--[HERE]"); } @Test @@ -358,7 +358,7 @@ void executionTestWithPlayerArgument() { server.dispatchCommand(player, "test APlayer"); assertEquals(player, results.get()); - assertInvalidSyntax(player, "test BPlayer"); + assertCommandFailsWith(player, "test BPlayer", "That player does not exist"); assertNoMoreResults(results); } diff --git a/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java b/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java index 2ccf0df5b4..3de8ffeff9 100644 --- a/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java +++ b/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java @@ -51,28 +51,6 @@ public MultiLiteralArgument(String nodeName, String... literals) { this.literals = literals; } - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.0.2", forRemoval = true) - public MultiLiteralArgument(final List literals) { - this(null, literals); - } - - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * - * @param nodeName the node name for this argument - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.1.0", forRemoval = true) - public MultiLiteralArgument(String nodeName, final List literals) { - this(nodeName, literals.toArray(new String[0])); - } - @Override public Class getPrimitiveType() { return String.class; diff --git a/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java b/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java index ee7fca3572..3de8ffeff9 100644 --- a/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java +++ b/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/src/main/java/dev/jorel/commandapi/arguments/MultiLiteralArgument.java @@ -51,28 +51,6 @@ public MultiLiteralArgument(String nodeName, String... literals) { this.literals = literals; } - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.0.2", forRemoval = true) - public MultiLiteralArgument(final String[] literals) { - this(null, literals); - } - - /** - * A multiliteral argument. Takes in string literals which cannot be modified - * - * @param nodeName the node name for this argument - * @param literals the literals that this argument represents - * @deprecated Use {@link MultiLiteralArgument#MultiLiteralArgument(String, String...)} instead - */ - @Deprecated(since = "9.1.0", forRemoval = true) - public MultiLiteralArgument(String nodeName, final List literals) { - this(nodeName, literals.toArray(new String[0])); - } - @Override public Class getPrimitiveType() { return String.class; diff --git a/docssrc/src/upgrading.md b/docssrc/src/upgrading.md index b7ef465e24..1a82f0e92f 100644 --- a/docssrc/src/upgrading.md +++ b/docssrc/src/upgrading.md @@ -1,5 +1,11 @@ # Upgrading guide +## From 9.?.? to 10.0.0 + +### Deprecated methods + +For 10.0.0, all previously deprecated methods have been removed. Please make sure you use the replacement methods for the deprecated methods. The replacement methods should be described in the JavaDocs of deprecated methods. + ## From 9.2.0 to 9.3.0 The `BukkitTooltip.generateAdvenureComponents` methods have now been deprecated in favour of the correctly named `BukkitTooltip.generateAdventureComponents` methods: