Renamed project to 'Brigadier'

This commit is contained in:
Nathan Adams 2014-10-02 13:00:29 +02:00
parent 8c5338a6bd
commit ef4199e824
42 changed files with 134 additions and 134 deletions

View file

@ -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'
}
}
}

View file

@ -0,0 +1,7 @@
package com.mojang.brigadier;
import com.mojang.brigadier.context.CommandContext;
public interface Command {
void run(CommandContext context);
}

View file

@ -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<T> {
public static final SimpleCommandExceptionType ERROR_UNKNOWN_COMMAND = new SimpleCommandExceptionType("unknown_command", "Unknown command");

View file

@ -0,0 +1,8 @@
package com.mojang.brigadier.arguments;
import com.mojang.brigadier.context.ParsedArgument;
import com.mojang.brigadier.exceptions.CommandException;
public interface CommandArgumentType<T> {
ParsedArgument<T> parse(String command) throws CommandException;
}

View file

@ -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<Integer> {
public static final ParameterizedCommandExceptionType ERROR_NOT_A_NUMBER = new ParameterizedCommandExceptionType("argument-integer-invalid", "Expected an integer, found '${found}'", "found");

View file

@ -1,4 +1,4 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.context;
package com.mojang.brigadier.arguments;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -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;

View file

@ -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<LiteralArgumentBuilder> {
private final String literal;

View file

@ -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<T> extends ArgumentBuilder<RequiredArgumentBuilder<T>> {
private final String name;

View file

@ -1,4 +1,4 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.builder;
package com.mojang.brigadier.builder;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -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;

View file

@ -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;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.context;
package com.mojang.brigadier.context;
public class ParsedArgument<T> {
private final String raw;

View file

@ -0,0 +1,4 @@
@ParametersAreNonnullByDefault
package com.mojang.brigadier.context;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.exceptions;
package com.mojang.brigadier.exceptions;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.exceptions;
package com.mojang.brigadier.exceptions;
public interface CommandExceptionType {
String getTypeName();

View file

@ -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;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.exceptions;
package com.mojang.brigadier.exceptions;
import com.google.common.collect.ImmutableMap;

View file

@ -0,0 +1,4 @@
@ParametersAreNonnullByDefault
package com.mojang.brigadier.exceptions;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,4 +1,4 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands;
package com.mojang.brigadier;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -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<T> extends CommandNode {
private final String name;

View file

@ -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;

View file

@ -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");

View file

@ -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() {

View file

@ -1,4 +1,4 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.tree;
package com.mojang.brigadier.tree;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,7 +0,0 @@
package net.minecraft.commands;
import net.minecraft.commands.context.CommandContext;
public interface Command {
void run(CommandContext context);
}

View file

@ -1,8 +0,0 @@
package net.minecraft.commands.arguments;
import net.minecraft.commands.context.ParsedArgument;
import net.minecraft.commands.exceptions.CommandException;
public interface CommandArgumentType<T> {
ParsedArgument<T> parse(String command) throws CommandException;
}

View file

@ -1,4 +0,0 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.arguments;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -1,4 +0,0 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.exceptions;
import javax.annotation.ParametersAreNonnullByDefault;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.context;
package com.mojang.brigadier.context;
import com.google.common.testing.EqualsTester;
import org.junit.Test;

View file

@ -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;

View file

@ -1,4 +1,4 @@
package net.minecraft.commands.exceptions;
package com.mojang.brigadier.exceptions;
import com.google.common.testing.EqualsTester;
import org.junit.Test;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;