From ef4199e824c62a0da053a8aa054b3beb3cd1d742 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 2 Oct 2014 13:00:29 +0200 Subject: [PATCH] Renamed project to 'Brigadier' --- build.gradle | 6 +++--- src/main/java/com/mojang/brigadier/Command.java | 7 +++++++ .../mojang/brigadier}/CommandDispatcher.java | 16 ++++++++-------- .../brigadier/arguments/CommandArgumentType.java | 8 ++++++++ .../arguments/IntegerArgumentType.java | 12 ++++++------ .../brigadier/arguments}/package-info.java | 2 +- .../brigadier}/builder/ArgumentBuilder.java | 8 ++++---- .../builder/LiteralArgumentBuilder.java | 6 +++--- .../builder/RequiredArgumentBuilder.java | 8 ++++---- .../mojang/brigadier}/builder/package-info.java | 2 +- .../brigadier}/context/CommandContext.java | 4 ++-- .../context/CommandContextBuilder.java | 4 ++-- .../brigadier}/context/ParsedArgument.java | 2 +- .../mojang/brigadier/context/package-info.java | 4 ++++ .../brigadier}/exceptions/CommandException.java | 2 +- .../exceptions/CommandExceptionType.java | 2 +- .../ParameterizedCommandExceptionType.java | 2 +- .../exceptions/SimpleCommandExceptionType.java | 2 +- .../brigadier/exceptions/package-info.java | 4 ++++ .../mojang/brigadier}/package-info.java | 2 +- .../brigadier}/tree/ArgumentCommandNode.java | 12 ++++++------ .../mojang/brigadier}/tree/CommandNode.java | 8 ++++---- .../brigadier}/tree/LiteralCommandNode.java | 12 ++++++------ .../mojang/brigadier}/tree/RootCommandNode.java | 6 +++--- .../mojang/brigadier}/tree/package-info.java | 2 +- .../java/net/minecraft/commands/Command.java | 7 ------- .../commands/arguments/CommandArgumentType.java | 8 -------- .../commands/arguments/package-info.java | 4 ---- .../commands/exceptions/package-info.java | 4 ---- .../mojang/brigadier}/CommandDispatcherTest.java | 12 ++++++------ .../arguments/IntegerArgumentTypeTest.java | 14 +++++++------- .../brigadier}/builder/ArgumentBuilderTest.java | 8 ++++---- .../builder/LiteralArgumentBuilderTest.java | 10 +++++----- .../builder/RequiredArgumentBuilderTest.java | 12 ++++++------ .../brigadier}/context/CommandContextTest.java | 6 +++--- .../brigadier}/context/ParsedArgumentTest.java | 2 +- .../ParameterizedCommandExceptionTypeTest.java | 2 +- .../SimpleCommandExceptionTypeTest.java | 2 +- .../brigadier}/tree/AbstractCommandNodeTest.java | 6 +++--- .../brigadier}/tree/ArgumentCommandNodeTest.java | 12 ++++++------ .../brigadier}/tree/LiteralCommandNodeTest.java | 10 +++++----- .../brigadier}/tree/RootCommandNodeTest.java | 6 +++--- 42 files changed, 134 insertions(+), 134 deletions(-) create mode 100644 src/main/java/com/mojang/brigadier/Command.java rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/CommandDispatcher.java (77%) create mode 100644 src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/arguments/IntegerArgumentType.java (89%) rename src/main/java/{net/minecraft/commands/context => com/mojang/brigadier/arguments}/package-info.java (68%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/builder/ArgumentBuilder.java (79%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/builder/LiteralArgumentBuilder.java (84%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/builder/RequiredArgumentBuilder.java (82%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/builder/package-info.java (68%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/context/CommandContext.java (95%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/context/CommandContextBuilder.java (93%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/context/ParsedArgument.java (95%) create mode 100644 src/main/java/com/mojang/brigadier/context/package-info.java rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/CommandException.java (92%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/CommandExceptionType.java (74%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/ParameterizedCommandExceptionType.java (97%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/SimpleCommandExceptionType.java (95%) create mode 100644 src/main/java/com/mojang/brigadier/exceptions/package-info.java rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/package-info.java (72%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/tree/ArgumentCommandNode.java (82%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/tree/CommandNode.java (89%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/tree/LiteralCommandNode.java (82%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/tree/RootCommandNode.java (79%) rename src/main/java/{net/minecraft/commands => com/mojang/brigadier}/tree/package-info.java (69%) delete mode 100644 src/main/java/net/minecraft/commands/Command.java delete mode 100644 src/main/java/net/minecraft/commands/arguments/CommandArgumentType.java delete mode 100644 src/main/java/net/minecraft/commands/arguments/package-info.java delete mode 100644 src/main/java/net/minecraft/commands/exceptions/package-info.java rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/CommandDispatcherTest.java (89%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/arguments/IntegerArgumentTypeTest.java (89%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/builder/ArgumentBuilderTest.java (80%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/builder/LiteralArgumentBuilderTest.java (79%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/builder/RequiredArgumentBuilderTest.java (78%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/context/CommandContextTest.java (94%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/context/ParsedArgumentTest.java (93%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/ParameterizedCommandExceptionTypeTest.java (97%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/exceptions/SimpleCommandExceptionTypeTest.java (96%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/tree/AbstractCommandNodeTest.java (92%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/tree/ArgumentCommandNodeTest.java (87%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/tree/LiteralCommandNodeTest.java (88%) rename src/test/java/{net/minecraft/commands => com/mojang/brigadier}/tree/RootCommandNodeTest.java (88%) diff --git a/build.gradle b/build.gradle index acac085..da24839 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'maven' apply plugin: 'eclipse' version = '0.0.1' -archivesBaseName = 'minecraft-commands' +archivesBaseName = 'brigadier' group = 'com.mojang' sourceCompatibility = 1.6 @@ -61,8 +61,8 @@ uploadArchives { repository(url: "file://" + repoDir.absolutePath) pom.project { - description 'Minecraft Command Handler' - url 'http://github.com/Mojang/minecraft-commands' + description 'Command Registration & Dispatch System' + url 'http://github.com/Mojang/brigadier' } } } diff --git a/src/main/java/com/mojang/brigadier/Command.java b/src/main/java/com/mojang/brigadier/Command.java new file mode 100644 index 0000000..2ee5e7a --- /dev/null +++ b/src/main/java/com/mojang/brigadier/Command.java @@ -0,0 +1,7 @@ +package com.mojang.brigadier; + +import com.mojang.brigadier.context.CommandContext; + +public interface Command { + void run(CommandContext context); +} diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/com/mojang/brigadier/CommandDispatcher.java similarity index 77% rename from src/main/java/net/minecraft/commands/CommandDispatcher.java rename to src/main/java/com/mojang/brigadier/CommandDispatcher.java index cbd1f4d..a4f27fe 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/com/mojang/brigadier/CommandDispatcher.java @@ -1,12 +1,12 @@ -package net.minecraft.commands; +package com.mojang.brigadier; -import net.minecraft.commands.builder.LiteralArgumentBuilder; -import net.minecraft.commands.context.CommandContext; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; -import net.minecraft.commands.exceptions.SimpleCommandExceptionType; -import net.minecraft.commands.tree.CommandNode; -import net.minecraft.commands.tree.RootCommandNode; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; +import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.RootCommandNode; public class CommandDispatcher { public static final SimpleCommandExceptionType ERROR_UNKNOWN_COMMAND = new SimpleCommandExceptionType("unknown_command", "Unknown command"); diff --git a/src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java new file mode 100644 index 0000000..5a869d7 --- /dev/null +++ b/src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java @@ -0,0 +1,8 @@ +package com.mojang.brigadier.arguments; + +import com.mojang.brigadier.context.ParsedArgument; +import com.mojang.brigadier.exceptions.CommandException; + +public interface CommandArgumentType { + ParsedArgument parse(String command) throws CommandException; +} diff --git a/src/main/java/net/minecraft/commands/arguments/IntegerArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java similarity index 89% rename from src/main/java/net/minecraft/commands/arguments/IntegerArgumentType.java rename to src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java index 7291548..6594600 100644 --- a/src/main/java/net/minecraft/commands/arguments/IntegerArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java @@ -1,11 +1,11 @@ -package net.minecraft.commands.arguments; +package com.mojang.brigadier.arguments; import com.google.common.base.Splitter; -import net.minecraft.commands.CommandDispatcher; -import net.minecraft.commands.context.CommandContext; -import net.minecraft.commands.context.ParsedArgument; -import net.minecraft.commands.exceptions.CommandException; -import net.minecraft.commands.exceptions.ParameterizedCommandExceptionType; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.context.ParsedArgument; +import com.mojang.brigadier.exceptions.CommandException; +import com.mojang.brigadier.exceptions.ParameterizedCommandExceptionType; public class IntegerArgumentType implements CommandArgumentType { public static final ParameterizedCommandExceptionType ERROR_NOT_A_NUMBER = new ParameterizedCommandExceptionType("argument-integer-invalid", "Expected an integer, found '${found}'", "found"); diff --git a/src/main/java/net/minecraft/commands/context/package-info.java b/src/main/java/com/mojang/brigadier/arguments/package-info.java similarity index 68% rename from src/main/java/net/minecraft/commands/context/package-info.java rename to src/main/java/com/mojang/brigadier/arguments/package-info.java index 5397ef1..6fdd362 100644 --- a/src/main/java/net/minecraft/commands/context/package-info.java +++ b/src/main/java/com/mojang/brigadier/arguments/package-info.java @@ -1,4 +1,4 @@ @ParametersAreNonnullByDefault -package net.minecraft.commands.context; +package com.mojang.brigadier.arguments; import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/builder/ArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java similarity index 79% rename from src/main/java/net/minecraft/commands/builder/ArgumentBuilder.java rename to src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java index 9058f9e..8bd54bd 100644 --- a/src/main/java/net/minecraft/commands/builder/ArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java @@ -1,8 +1,8 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.Command; -import net.minecraft.commands.tree.CommandNode; -import net.minecraft.commands.tree.RootCommandNode; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.RootCommandNode; import java.util.Collection; diff --git a/src/main/java/net/minecraft/commands/builder/LiteralArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java similarity index 84% rename from src/main/java/net/minecraft/commands/builder/LiteralArgumentBuilder.java rename to src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java index e9b8d0b..83f21df 100644 --- a/src/main/java/net/minecraft/commands/builder/LiteralArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java @@ -1,7 +1,7 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.tree.CommandNode; -import net.minecraft.commands.tree.LiteralCommandNode; +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.LiteralCommandNode; public class LiteralArgumentBuilder extends ArgumentBuilder { private final String literal; diff --git a/src/main/java/net/minecraft/commands/builder/RequiredArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java similarity index 82% rename from src/main/java/net/minecraft/commands/builder/RequiredArgumentBuilder.java rename to src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java index 689eb4c..204a453 100644 --- a/src/main/java/net/minecraft/commands/builder/RequiredArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java @@ -1,8 +1,8 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.arguments.CommandArgumentType; -import net.minecraft.commands.tree.ArgumentCommandNode; -import net.minecraft.commands.tree.CommandNode; +import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.tree.ArgumentCommandNode; +import com.mojang.brigadier.tree.CommandNode; public class RequiredArgumentBuilder extends ArgumentBuilder> { private final String name; diff --git a/src/main/java/net/minecraft/commands/builder/package-info.java b/src/main/java/com/mojang/brigadier/builder/package-info.java similarity index 68% rename from src/main/java/net/minecraft/commands/builder/package-info.java rename to src/main/java/com/mojang/brigadier/builder/package-info.java index f6f5bad..f2f8816 100644 --- a/src/main/java/net/minecraft/commands/builder/package-info.java +++ b/src/main/java/com/mojang/brigadier/builder/package-info.java @@ -1,4 +1,4 @@ @ParametersAreNonnullByDefault -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/context/CommandContext.java b/src/main/java/com/mojang/brigadier/context/CommandContext.java similarity index 95% rename from src/main/java/net/minecraft/commands/context/CommandContext.java rename to src/main/java/com/mojang/brigadier/context/CommandContext.java index 828c618..09d76a1 100644 --- a/src/main/java/net/minecraft/commands/context/CommandContext.java +++ b/src/main/java/com/mojang/brigadier/context/CommandContext.java @@ -1,7 +1,7 @@ -package net.minecraft.commands.context; +package com.mojang.brigadier.context; import com.google.common.primitives.Primitives; -import net.minecraft.commands.Command; +import com.mojang.brigadier.Command; import java.util.Map; diff --git a/src/main/java/net/minecraft/commands/context/CommandContextBuilder.java b/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java similarity index 93% rename from src/main/java/net/minecraft/commands/context/CommandContextBuilder.java rename to src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java index 3e76600..0ca2ab2 100644 --- a/src/main/java/net/minecraft/commands/context/CommandContextBuilder.java +++ b/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java @@ -1,7 +1,7 @@ -package net.minecraft.commands.context; +package com.mojang.brigadier.context; import com.google.common.collect.Maps; -import net.minecraft.commands.Command; +import com.mojang.brigadier.Command; import java.util.Map; diff --git a/src/main/java/net/minecraft/commands/context/ParsedArgument.java b/src/main/java/com/mojang/brigadier/context/ParsedArgument.java similarity index 95% rename from src/main/java/net/minecraft/commands/context/ParsedArgument.java rename to src/main/java/com/mojang/brigadier/context/ParsedArgument.java index c47257f..7d4ed3a 100644 --- a/src/main/java/net/minecraft/commands/context/ParsedArgument.java +++ b/src/main/java/com/mojang/brigadier/context/ParsedArgument.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.context; +package com.mojang.brigadier.context; public class ParsedArgument { private final String raw; diff --git a/src/main/java/com/mojang/brigadier/context/package-info.java b/src/main/java/com/mojang/brigadier/context/package-info.java new file mode 100644 index 0000000..4cf2a59 --- /dev/null +++ b/src/main/java/com/mojang/brigadier/context/package-info.java @@ -0,0 +1,4 @@ +@ParametersAreNonnullByDefault +package com.mojang.brigadier.context; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/exceptions/CommandException.java b/src/main/java/com/mojang/brigadier/exceptions/CommandException.java similarity index 92% rename from src/main/java/net/minecraft/commands/exceptions/CommandException.java rename to src/main/java/com/mojang/brigadier/exceptions/CommandException.java index 6295144..46ec457 100644 --- a/src/main/java/net/minecraft/commands/exceptions/CommandException.java +++ b/src/main/java/com/mojang/brigadier/exceptions/CommandException.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; import java.util.Map; diff --git a/src/main/java/net/minecraft/commands/exceptions/CommandExceptionType.java b/src/main/java/com/mojang/brigadier/exceptions/CommandExceptionType.java similarity index 74% rename from src/main/java/net/minecraft/commands/exceptions/CommandExceptionType.java rename to src/main/java/com/mojang/brigadier/exceptions/CommandExceptionType.java index b8b4d98..2a0ac70 100644 --- a/src/main/java/net/minecraft/commands/exceptions/CommandExceptionType.java +++ b/src/main/java/com/mojang/brigadier/exceptions/CommandExceptionType.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; public interface CommandExceptionType { String getTypeName(); diff --git a/src/main/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionType.java b/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java similarity index 97% rename from src/main/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionType.java rename to src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java index ca52421..ac7f3d7 100644 --- a/src/main/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionType.java +++ b/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; diff --git a/src/main/java/net/minecraft/commands/exceptions/SimpleCommandExceptionType.java b/src/main/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionType.java similarity index 95% rename from src/main/java/net/minecraft/commands/exceptions/SimpleCommandExceptionType.java rename to src/main/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionType.java index beed886..d9c4ad2 100644 --- a/src/main/java/net/minecraft/commands/exceptions/SimpleCommandExceptionType.java +++ b/src/main/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionType.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; import com.google.common.collect.ImmutableMap; diff --git a/src/main/java/com/mojang/brigadier/exceptions/package-info.java b/src/main/java/com/mojang/brigadier/exceptions/package-info.java new file mode 100644 index 0000000..f531b11 --- /dev/null +++ b/src/main/java/com/mojang/brigadier/exceptions/package-info.java @@ -0,0 +1,4 @@ +@ParametersAreNonnullByDefault +package com.mojang.brigadier.exceptions; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/package-info.java b/src/main/java/com/mojang/brigadier/package-info.java similarity index 72% rename from src/main/java/net/minecraft/commands/package-info.java rename to src/main/java/com/mojang/brigadier/package-info.java index 2f52d76..9f58053 100644 --- a/src/main/java/net/minecraft/commands/package-info.java +++ b/src/main/java/com/mojang/brigadier/package-info.java @@ -1,4 +1,4 @@ @ParametersAreNonnullByDefault -package net.minecraft.commands; +package com.mojang.brigadier; import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/tree/ArgumentCommandNode.java b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java similarity index 82% rename from src/main/java/net/minecraft/commands/tree/ArgumentCommandNode.java rename to src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java index bee71b1..33808ba 100644 --- a/src/main/java/net/minecraft/commands/tree/ArgumentCommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java @@ -1,10 +1,10 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; -import net.minecraft.commands.Command; -import net.minecraft.commands.arguments.CommandArgumentType; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.context.ParsedArgument; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.context.ParsedArgument; +import com.mojang.brigadier.exceptions.CommandException; public class ArgumentCommandNode extends CommandNode { private final String name; diff --git a/src/main/java/net/minecraft/commands/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java similarity index 89% rename from src/main/java/net/minecraft/commands/tree/CommandNode.java rename to src/main/java/com/mojang/brigadier/tree/CommandNode.java index d323e5a..54ccc74 100644 --- a/src/main/java/net/minecraft/commands/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -1,9 +1,9 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; import com.google.common.collect.Maps; -import net.minecraft.commands.Command; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; import java.util.Collection; import java.util.Map; diff --git a/src/main/java/net/minecraft/commands/tree/LiteralCommandNode.java b/src/main/java/com/mojang/brigadier/tree/LiteralCommandNode.java similarity index 82% rename from src/main/java/net/minecraft/commands/tree/LiteralCommandNode.java rename to src/main/java/com/mojang/brigadier/tree/LiteralCommandNode.java index 6eb7659..062a8fb 100644 --- a/src/main/java/net/minecraft/commands/tree/LiteralCommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/LiteralCommandNode.java @@ -1,10 +1,10 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; -import net.minecraft.commands.Command; -import net.minecraft.commands.CommandDispatcher; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; -import net.minecraft.commands.exceptions.ParameterizedCommandExceptionType; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; +import com.mojang.brigadier.exceptions.ParameterizedCommandExceptionType; public class LiteralCommandNode extends CommandNode { public static final ParameterizedCommandExceptionType ERROR_INCORRECT_LITERAL = new ParameterizedCommandExceptionType("incorrect_literal", "Expected literal ${expected}", "expected"); diff --git a/src/main/java/net/minecraft/commands/tree/RootCommandNode.java b/src/main/java/com/mojang/brigadier/tree/RootCommandNode.java similarity index 79% rename from src/main/java/net/minecraft/commands/tree/RootCommandNode.java rename to src/main/java/com/mojang/brigadier/tree/RootCommandNode.java index 4bb9838..140a674 100644 --- a/src/main/java/net/minecraft/commands/tree/RootCommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/RootCommandNode.java @@ -1,7 +1,7 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; public class RootCommandNode extends CommandNode { public RootCommandNode() { diff --git a/src/main/java/net/minecraft/commands/tree/package-info.java b/src/main/java/com/mojang/brigadier/tree/package-info.java similarity index 69% rename from src/main/java/net/minecraft/commands/tree/package-info.java rename to src/main/java/com/mojang/brigadier/tree/package-info.java index 3742bbb..fdc0985 100644 --- a/src/main/java/net/minecraft/commands/tree/package-info.java +++ b/src/main/java/com/mojang/brigadier/tree/package-info.java @@ -1,4 +1,4 @@ @ParametersAreNonnullByDefault -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/Command.java b/src/main/java/net/minecraft/commands/Command.java deleted file mode 100644 index 95c518c..0000000 --- a/src/main/java/net/minecraft/commands/Command.java +++ /dev/null @@ -1,7 +0,0 @@ -package net.minecraft.commands; - -import net.minecraft.commands.context.CommandContext; - -public interface Command { - void run(CommandContext context); -} diff --git a/src/main/java/net/minecraft/commands/arguments/CommandArgumentType.java b/src/main/java/net/minecraft/commands/arguments/CommandArgumentType.java deleted file mode 100644 index 7e608fa..0000000 --- a/src/main/java/net/minecraft/commands/arguments/CommandArgumentType.java +++ /dev/null @@ -1,8 +0,0 @@ -package net.minecraft.commands.arguments; - -import net.minecraft.commands.context.ParsedArgument; -import net.minecraft.commands.exceptions.CommandException; - -public interface CommandArgumentType { - ParsedArgument parse(String command) throws CommandException; -} diff --git a/src/main/java/net/minecraft/commands/arguments/package-info.java b/src/main/java/net/minecraft/commands/arguments/package-info.java deleted file mode 100644 index 8b993d7..0000000 --- a/src/main/java/net/minecraft/commands/arguments/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@ParametersAreNonnullByDefault -package net.minecraft.commands.arguments; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/net/minecraft/commands/exceptions/package-info.java b/src/main/java/net/minecraft/commands/exceptions/package-info.java deleted file mode 100644 index 703ac70..0000000 --- a/src/main/java/net/minecraft/commands/exceptions/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@ParametersAreNonnullByDefault -package net.minecraft.commands.exceptions; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/test/java/net/minecraft/commands/CommandDispatcherTest.java b/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java similarity index 89% rename from src/test/java/net/minecraft/commands/CommandDispatcherTest.java rename to src/test/java/com/mojang/brigadier/CommandDispatcherTest.java index 91c5f1c..16d0f46 100644 --- a/src/test/java/net/minecraft/commands/CommandDispatcherTest.java +++ b/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java @@ -1,16 +1,16 @@ -package net.minecraft.commands; +package com.mojang.brigadier; -import net.minecraft.commands.context.CommandContext; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandException; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; -import static net.minecraft.commands.builder.LiteralArgumentBuilder.literal; -import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.builder.LiteralArgumentBuilder.literal; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; diff --git a/src/test/java/net/minecraft/commands/arguments/IntegerArgumentTypeTest.java b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java similarity index 89% rename from src/test/java/net/minecraft/commands/arguments/IntegerArgumentTypeTest.java rename to src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java index 06f026f..dd43684 100644 --- a/src/test/java/net/minecraft/commands/arguments/IntegerArgumentTypeTest.java +++ b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java @@ -1,18 +1,18 @@ -package net.minecraft.commands.arguments; +package com.mojang.brigadier.arguments; import com.google.common.collect.ImmutableMap; import com.google.common.testing.EqualsTester; -import net.minecraft.commands.context.CommandContext; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.context.ParsedArgument; -import net.minecraft.commands.exceptions.CommandException; -import net.minecraft.commands.exceptions.CommandExceptionType; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.context.ParsedArgument; +import com.mojang.brigadier.exceptions.CommandException; +import com.mojang.brigadier.exceptions.CommandExceptionType; import org.junit.Before; import org.junit.Test; import java.util.Map; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/src/test/java/net/minecraft/commands/builder/ArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java similarity index 80% rename from src/test/java/net/minecraft/commands/builder/ArgumentBuilderTest.java rename to src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java index e39f72a..0ef59ba 100644 --- a/src/test/java/net/minecraft/commands/builder/ArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java @@ -1,11 +1,11 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.tree.CommandNode; +import com.mojang.brigadier.tree.CommandNode; import org.junit.Before; import org.junit.Test; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; -import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; diff --git a/src/test/java/net/minecraft/commands/builder/LiteralArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java similarity index 79% rename from src/test/java/net/minecraft/commands/builder/LiteralArgumentBuilderTest.java rename to src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java index e110882..5100c26 100644 --- a/src/test/java/net/minecraft/commands/builder/LiteralArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java @@ -1,13 +1,13 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.Command; -import net.minecraft.commands.tree.LiteralCommandNode; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.tree.LiteralCommandNode; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; -import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/src/test/java/net/minecraft/commands/builder/RequiredArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java similarity index 78% rename from src/test/java/net/minecraft/commands/builder/RequiredArgumentBuilderTest.java rename to src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java index 437dc22..2d09237 100644 --- a/src/test/java/net/minecraft/commands/builder/RequiredArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java @@ -1,14 +1,14 @@ -package net.minecraft.commands.builder; +package com.mojang.brigadier.builder; -import net.minecraft.commands.Command; -import net.minecraft.commands.arguments.CommandArgumentType; -import net.minecraft.commands.tree.ArgumentCommandNode; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.tree.ArgumentCommandNode; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; -import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/src/test/java/net/minecraft/commands/context/CommandContextTest.java b/src/test/java/com/mojang/brigadier/context/CommandContextTest.java similarity index 94% rename from src/test/java/net/minecraft/commands/context/CommandContextTest.java rename to src/test/java/com/mojang/brigadier/context/CommandContextTest.java index 1c448c9..892a8b3 100644 --- a/src/test/java/net/minecraft/commands/context/CommandContextTest.java +++ b/src/test/java/com/mojang/brigadier/context/CommandContextTest.java @@ -1,14 +1,14 @@ -package net.minecraft.commands.context; +package com.mojang.brigadier.context; import com.google.common.testing.EqualsTester; -import net.minecraft.commands.Command; +import com.mojang.brigadier.Command; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; diff --git a/src/test/java/net/minecraft/commands/context/ParsedArgumentTest.java b/src/test/java/com/mojang/brigadier/context/ParsedArgumentTest.java similarity index 93% rename from src/test/java/net/minecraft/commands/context/ParsedArgumentTest.java rename to src/test/java/com/mojang/brigadier/context/ParsedArgumentTest.java index c3b69c1..0599b6f 100644 --- a/src/test/java/net/minecraft/commands/context/ParsedArgumentTest.java +++ b/src/test/java/com/mojang/brigadier/context/ParsedArgumentTest.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.context; +package com.mojang.brigadier.context; import com.google.common.testing.EqualsTester; import org.junit.Test; diff --git a/src/test/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionTypeTest.java b/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java similarity index 97% rename from src/test/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionTypeTest.java rename to src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java index cac7518..5b8e925 100644 --- a/src/test/java/net/minecraft/commands/exceptions/ParameterizedCommandExceptionTypeTest.java +++ b/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; import com.google.common.collect.ImmutableMap; import com.google.common.testing.EqualsTester; diff --git a/src/test/java/net/minecraft/commands/exceptions/SimpleCommandExceptionTypeTest.java b/src/test/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionTypeTest.java similarity index 96% rename from src/test/java/net/minecraft/commands/exceptions/SimpleCommandExceptionTypeTest.java rename to src/test/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionTypeTest.java index 756eb35..66d6263 100644 --- a/src/test/java/net/minecraft/commands/exceptions/SimpleCommandExceptionTypeTest.java +++ b/src/test/java/com/mojang/brigadier/exceptions/SimpleCommandExceptionTypeTest.java @@ -1,4 +1,4 @@ -package net.minecraft.commands.exceptions; +package com.mojang.brigadier.exceptions; import com.google.common.testing.EqualsTester; import org.junit.Test; diff --git a/src/test/java/net/minecraft/commands/tree/AbstractCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/AbstractCommandNodeTest.java similarity index 92% rename from src/test/java/net/minecraft/commands/tree/AbstractCommandNodeTest.java rename to src/test/java/com/mojang/brigadier/tree/AbstractCommandNodeTest.java index bb66cb4..26a153d 100644 --- a/src/test/java/net/minecraft/commands/tree/AbstractCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/AbstractCommandNodeTest.java @@ -1,12 +1,12 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; -import net.minecraft.commands.Command; +import com.mojang.brigadier.Command; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; -import static net.minecraft.commands.builder.LiteralArgumentBuilder.literal; +import static com.mojang.brigadier.builder.LiteralArgumentBuilder.literal; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/src/test/java/net/minecraft/commands/tree/ArgumentCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java similarity index 87% rename from src/test/java/net/minecraft/commands/tree/ArgumentCommandNodeTest.java rename to src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java index 3f76ca8..4f4fa0b 100644 --- a/src/test/java/net/minecraft/commands/tree/ArgumentCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java @@ -1,14 +1,14 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; import com.google.common.testing.EqualsTester; -import net.minecraft.commands.Command; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; import org.junit.Before; import org.junit.Test; -import static net.minecraft.commands.arguments.IntegerArgumentType.integer; -import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument; +import static com.mojang.brigadier.arguments.IntegerArgumentType.integer; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; diff --git a/src/test/java/net/minecraft/commands/tree/LiteralCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java similarity index 88% rename from src/test/java/net/minecraft/commands/tree/LiteralCommandNodeTest.java rename to src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java index 79d7b6a..c8f4c12 100644 --- a/src/test/java/net/minecraft/commands/tree/LiteralCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java @@ -1,13 +1,13 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; import com.google.common.testing.EqualsTester; -import net.minecraft.commands.Command; -import net.minecraft.commands.context.CommandContextBuilder; -import net.minecraft.commands.exceptions.CommandException; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.context.CommandContextBuilder; +import com.mojang.brigadier.exceptions.CommandException; import org.junit.Before; import org.junit.Test; -import static net.minecraft.commands.builder.LiteralArgumentBuilder.literal; +import static com.mojang.brigadier.builder.LiteralArgumentBuilder.literal; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; diff --git a/src/test/java/net/minecraft/commands/tree/RootCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java similarity index 88% rename from src/test/java/net/minecraft/commands/tree/RootCommandNodeTest.java rename to src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java index 713e691..b5054f9 100644 --- a/src/test/java/net/minecraft/commands/tree/RootCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java @@ -1,11 +1,11 @@ -package net.minecraft.commands.tree; +package com.mojang.brigadier.tree; import com.google.common.testing.EqualsTester; -import net.minecraft.commands.context.CommandContextBuilder; +import com.mojang.brigadier.context.CommandContextBuilder; import org.junit.Before; import org.junit.Test; -import static net.minecraft.commands.builder.LiteralArgumentBuilder.literal; +import static com.mojang.brigadier.builder.LiteralArgumentBuilder.literal; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat;