From d85684c22a1a1f4abc0bf988c6b3a22c652a57aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Mon, 28 Sep 2020 12:32:10 +0200 Subject: [PATCH] :zap: Fix merge conflicts --- .../java/cloud/commandframework/Command.java | 15 ++++++---- .../cloud/commandframework/CommandTree.java | 1 + .../StandardCommandSyntaxFormatter.java | 1 + .../arguments/compound/ArgumentPair.java | 22 +++++++------- .../arguments/compound/ArgumentTriplet.java | 30 +++++++++---------- .../arguments/compound/CompoundArgument.java | 12 ++++---- .../arguments/compound/package-info.java | 2 +- .../commandframework}/types/tuples/Tuple.java | 4 +-- .../CommandHelpHandlerTest.java | 1 + .../CommandSuggestionsTest.java | 3 +- .../commandframework/CommandTreeTest.java | 2 ++ .../brigadier/CloudBrigadierManager.java | 5 ++-- .../cloud/commandframework/BukkitTest.java | 8 +++-- 13 files changed, 60 insertions(+), 46 deletions(-) rename cloud-core/src/main/java/{com/intellectualsites/commands => cloud/commandframework}/arguments/compound/ArgumentPair.java (89%) rename cloud-core/src/main/java/{com/intellectualsites/commands => cloud/commandframework}/arguments/compound/ArgumentTriplet.java (85%) rename cloud-core/src/main/java/{com/intellectualsites/commands => cloud/commandframework}/arguments/compound/CompoundArgument.java (93%) rename cloud-core/src/main/java/{com/intellectualsites/commands => cloud/commandframework}/arguments/compound/package-info.java (95%) rename cloud-core/src/main/java/{com/intellectualsites/commands => cloud/commandframework}/types/tuples/Tuple.java (93%) diff --git a/cloud-core/src/main/java/cloud/commandframework/Command.java b/cloud-core/src/main/java/cloud/commandframework/Command.java index 4889825f..b43a587e 100644 --- a/cloud-core/src/main/java/cloud/commandframework/Command.java +++ b/cloud-core/src/main/java/cloud/commandframework/Command.java @@ -25,11 +25,16 @@ package cloud.commandframework; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.compound.ArgumentPair; +import cloud.commandframework.arguments.compound.ArgumentTriplet; import cloud.commandframework.execution.CommandExecutionHandler; import cloud.commandframework.meta.CommandMeta; import cloud.commandframework.meta.SimpleCommandMeta; import cloud.commandframework.permission.CommandPermission; import cloud.commandframework.permission.Permission; +import cloud.commandframework.types.tuples.Pair; +import cloud.commandframework.types.tuples.Triplet; +import com.google.common.reflect.TypeToken; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -393,7 +398,7 @@ public class Command { * @param name Name of the argument * @param names Pair containing the names of the sub-arguments * @param parserPair Pair containing the types of the sub-arguments. There must be parsers for these types registered - * in the {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} used by the + * in the {@link cloud.commandframework.arguments.parser.ParserRegistry} used by the * {@link CommandManager} attached to this command * @param description Description of the argument * @param First type @@ -422,7 +427,7 @@ public class Command { * @param outputType The output type * @param names Pair containing the names of the sub-arguments * @param parserPair Pair containing the types of the sub-arguments. There must be parsers for these types registered - * in the {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} used by the + * in the {@link cloud.commandframework.arguments.parser.ParserRegistry} used by the * {@link CommandManager} attached to this command * @param mapper Mapper that maps from {@link Pair} to the custom type * @param description Description of the argument @@ -447,7 +452,7 @@ public class Command { } /** - * Create a new argument pair that maps to {@link com.intellectualsites.commands.types.tuples.Triplet} + * Create a new argument pair that maps to {@link cloud.commandframework.types.tuples.Triplet} *

* For this to work, there must be a {@link CommandManager} * attached to the command builder. To guarantee this, it is recommended to get the command builder instance @@ -456,7 +461,7 @@ public class Command { * @param name Name of the argument * @param names Triplet containing the names of the sub-arguments * @param parserTriplet Triplet containing the types of the sub-arguments. There must be parsers for these types - * registered in the {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} + * registered in the {@link cloud.commandframework.arguments.parser.ParserRegistry} * used by the {@link CommandManager} attached to this command * @param description Description of the argument * @param First type @@ -486,7 +491,7 @@ public class Command { * @param outputType The output type * @param names Triplet containing the names of the sub-arguments * @param parserTriplet Triplet containing the types of the sub-arguments. There must be parsers for these types - * registered in the {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} used by + * registered in the {@link cloud.commandframework.arguments.parser.ParserRegistry} used by * the {@link CommandManager} attached to this command * @param mapper Mapper that maps from {@link Triplet} to the custom type * @param description Description of the argument diff --git a/cloud-core/src/main/java/cloud/commandframework/CommandTree.java b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java index 491ab2e2..1d396d8b 100644 --- a/cloud-core/src/main/java/cloud/commandframework/CommandTree.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java @@ -25,6 +25,7 @@ package cloud.commandframework; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.compound.CompoundArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.context.CommandContext; import cloud.commandframework.exceptions.AmbiguousNodeException; diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java b/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java index cc886111..df95ce7a 100644 --- a/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java @@ -24,6 +24,7 @@ package cloud.commandframework.arguments; import cloud.commandframework.CommandTree; +import cloud.commandframework.arguments.compound.CompoundArgument; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentPair.java b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentPair.java similarity index 89% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentPair.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentPair.java index 2017ac7d..7d4e653d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentPair.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentPair.java @@ -21,14 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.compound; +package cloud.commandframework.arguments.compound; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.arguments.parser.ParserRegistry; -import com.intellectualsites.commands.types.tuples.Pair; +import cloud.commandframework.CommandManager; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ParserParameters; +import cloud.commandframework.arguments.parser.ParserRegistry; +import cloud.commandframework.types.tuples.Pair; import javax.annotation.Nonnull; import java.util.function.Function; @@ -71,7 +71,7 @@ public final class ArgumentPair extends CompoundArgument, * @param name Argument name * @param names Sub-argument names * @param types Pair containing the types of the sub-arguments. There must be parsers for these types registered - * in the {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} used by the + * in the {@link cloud.commandframework.arguments.parser.ParserRegistry} used by the * {@link CommandManager} * @param Command sender type * @param First parsed type @@ -86,12 +86,12 @@ public final class ArgumentPair extends CompoundArgument, final ParserRegistry parserRegistry = manager.getParserRegistry(); final ArgumentParser firstParser = parserRegistry.createParser(TypeToken.of(types.getFirst()), ParserParameters.empty()).orElseThrow(() -> - new IllegalArgumentException( - "Could not create parser for primary type")); + new IllegalArgumentException( + "Could not create parser for primary type")); final ArgumentParser secondaryParser = parserRegistry.createParser(TypeToken.of(types.getSecond()), ParserParameters.empty()).orElseThrow(() -> - new IllegalArgumentException( - "Could not create parser for secondary type")); + new IllegalArgumentException( + "Could not create parser for secondary type")); return new ArgumentPairIntermediaryBuilder<>(true, name, names, Pair.of(firstParser, secondaryParser), types); } diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentTriplet.java b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentTriplet.java similarity index 85% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentTriplet.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentTriplet.java index e5e0d4b5..f634196f 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/ArgumentTriplet.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/ArgumentTriplet.java @@ -21,14 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.compound; +package cloud.commandframework.arguments.compound; +import cloud.commandframework.CommandManager; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ParserParameters; +import cloud.commandframework.arguments.parser.ParserRegistry; +import cloud.commandframework.types.tuples.Triplet; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.arguments.parser.ParserRegistry; -import com.intellectualsites.commands.types.tuples.Triplet; import javax.annotation.Nonnull; import java.util.function.Function; @@ -73,7 +73,7 @@ public final class ArgumentTriplet extends CompoundArgument Command sender type * @param First parsed type @@ -89,17 +89,17 @@ public final class ArgumentTriplet extends CompoundArgument, Class, Class> types) { final ParserRegistry parserRegistry = manager.getParserRegistry(); final ArgumentParser firstParser = parserRegistry.createParser(TypeToken.of(types.getFirst()), - ParserParameters.empty()).orElseThrow(() -> - new IllegalArgumentException( - "Could not create parser for primary type")); + ParserParameters.empty()).orElseThrow(() -> + new IllegalArgumentException( + "Could not create parser for primary type")); final ArgumentParser secondaryParser = parserRegistry.createParser(TypeToken.of(types.getSecond()), - ParserParameters.empty()).orElseThrow(() -> - new IllegalArgumentException( - "Could not create parser for secondary type")); + ParserParameters.empty()).orElseThrow(() -> + new IllegalArgumentException( + "Could not create parser for secondary type")); final ArgumentParser tertiaryParser = parserRegistry.createParser(TypeToken.of(types.getThird()), ParserParameters.empty()).orElseThrow(() -> - new IllegalArgumentException( - "Could not create parser for tertiary type")); + new IllegalArgumentException( + "Could not create parser for tertiary type")); return new ArgumentTripletIntermediaryBuilder<>(true, name, names, Triplet.of(firstParser, secondaryParser, tertiaryParser), types); } diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/CompoundArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/CompoundArgument.java similarity index 93% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/CompoundArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/compound/CompoundArgument.java index 09035107..c736e95c 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/CompoundArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/CompoundArgument.java @@ -21,14 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.compound; +package cloud.commandframework.arguments.compound; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.types.tuples.Tuple; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.types.tuples.Tuple; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/package-info.java b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/compound/package-info.java index 9d3ebc98..1a2f7ac7 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/compound/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/compound/package-info.java @@ -25,4 +25,4 @@ /** * Argument types that consists of 2 or more sub-types */ -package com.intellectualsites.commands.arguments.compound; +package cloud.commandframework.arguments.compound; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuple.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuple.java similarity index 93% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuple.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuple.java index 043b7988..474d0faf 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuple.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuple.java @@ -1,7 +1,7 @@ // // MIT License // -// Copyright (c) 2020 Alexander Söderberg +// Copyright (c) 2020 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 @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import javax.annotation.Nonnull; diff --git a/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java index 2354ccb2..558a54d3 100644 --- a/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java @@ -26,6 +26,7 @@ package cloud.commandframework; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.standard.IntegerArgument; import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.types.tuples.Pair; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java index 4e18dbe7..7f0150cc 100644 --- a/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java @@ -23,9 +23,10 @@ // package cloud.commandframework; +import cloud.commandframework.arguments.standard.EnumArgument; import cloud.commandframework.arguments.standard.IntegerArgument; import cloud.commandframework.arguments.standard.StringArgument; -import cloud.commandframework.arguments.standard.EnumArgument; +import cloud.commandframework.types.tuples.Pair; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java index 1bd64241..52b9a75e 100644 --- a/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java @@ -23,11 +23,13 @@ // package cloud.commandframework; +import cloud.commandframework.arguments.compound.ArgumentPair; import cloud.commandframework.arguments.standard.IntegerArgument; import cloud.commandframework.arguments.standard.StringArgument; import cloud.commandframework.context.CommandContext; import cloud.commandframework.exceptions.NoPermissionException; import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.types.tuples.Pair; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java index 9a8eae6e..ec2f5bd9 100644 --- a/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java +++ b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java @@ -23,13 +23,12 @@ // package cloud.commandframework.brigadier; -import com.google.common.collect.Maps; -import com.google.common.reflect.TypeToken; import cloud.commandframework.Command; import cloud.commandframework.CommandManager; import cloud.commandframework.CommandTree; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.compound.CompoundArgument; import cloud.commandframework.arguments.parser.ArgumentParser; import cloud.commandframework.arguments.standard.BooleanArgument; import cloud.commandframework.arguments.standard.ByteArgument; @@ -42,6 +41,8 @@ import cloud.commandframework.context.CommandContext; import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; import cloud.commandframework.permission.CommandPermission; import cloud.commandframework.permission.Permission; +import com.google.common.collect.Maps; +import com.google.common.reflect.TypeToken; import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.arguments.BoolArgumentType; diff --git a/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java index 1973dd87..8118799e 100644 --- a/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java +++ b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java @@ -23,13 +23,11 @@ // package cloud.commandframework; -import cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator; -import cloud.commandframework.extra.confirmation.CommandConfirmationManager; import cloud.commandframework.annotations.AnnotationParser; import cloud.commandframework.annotations.Argument; +import cloud.commandframework.annotations.CommandDescription; import cloud.commandframework.annotations.CommandMethod; import cloud.commandframework.annotations.Confirmation; -import cloud.commandframework.annotations.CommandDescription; import cloud.commandframework.annotations.specifier.Completions; import cloud.commandframework.annotations.specifier.Range; import cloud.commandframework.arguments.parser.ArgumentParseResult; @@ -45,9 +43,13 @@ import cloud.commandframework.bukkit.BukkitCommandMetaBuilder; import cloud.commandframework.bukkit.CloudBukkitCapabilities; import cloud.commandframework.bukkit.parsers.WorldArgument; import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator; import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.extra.confirmation.CommandConfirmationManager; import cloud.commandframework.meta.SimpleCommandMeta; import cloud.commandframework.paper.PaperCommandManager; +import cloud.commandframework.types.tuples.Triplet; +import com.google.common.reflect.TypeToken; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import org.bukkit.Bukkit; import org.bukkit.ChatColor;