Remove unused generic
This commit is contained in:
parent
107b852c74
commit
bbfb8a7da1
6 changed files with 11 additions and 9 deletions
|
@ -5,7 +5,6 @@ package com.mojang.brigadier.arguments;
|
||||||
|
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.context.CommandContext;
|
import com.mojang.brigadier.context.CommandContext;
|
||||||
import com.mojang.brigadier.context.CommandContextBuilder;
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import com.mojang.brigadier.suggestion.Suggestions;
|
import com.mojang.brigadier.suggestion.Suggestions;
|
||||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||||
|
@ -15,7 +14,7 @@ import java.util.Collections;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
public interface ArgumentType<T> {
|
public interface ArgumentType<T> {
|
||||||
<S> T parse(StringReader reader) throws CommandSyntaxException;
|
T parse(StringReader reader) throws CommandSyntaxException;
|
||||||
|
|
||||||
default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<S> context, final SuggestionsBuilder builder) {
|
default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<S> context, final SuggestionsBuilder builder) {
|
||||||
return Suggestions.empty();
|
return Suggestions.empty();
|
||||||
|
|
|
@ -5,7 +5,6 @@ package com.mojang.brigadier.arguments;
|
||||||
|
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.context.CommandContext;
|
import com.mojang.brigadier.context.CommandContext;
|
||||||
import com.mojang.brigadier.context.CommandContextBuilder;
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import com.mojang.brigadier.suggestion.Suggestions;
|
import com.mojang.brigadier.suggestion.Suggestions;
|
||||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||||
|
@ -29,7 +28,7 @@ public class BoolArgumentType implements ArgumentType<Boolean> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Boolean parse(final StringReader reader) throws CommandSyntaxException {
|
public Boolean parse(final StringReader reader) throws CommandSyntaxException {
|
||||||
return reader.readBoolean();
|
return reader.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class DoubleArgumentType implements ArgumentType<Double> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Double parse(final StringReader reader) throws CommandSyntaxException {
|
public Double parse(final StringReader reader) throws CommandSyntaxException {
|
||||||
final int start = reader.getCursor();
|
final int start = reader.getCursor();
|
||||||
final double result = reader.readDouble();
|
final double result = reader.readDouble();
|
||||||
if (result < minimum) {
|
if (result < minimum) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class FloatArgumentType implements ArgumentType<Float> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Float parse(final StringReader reader) throws CommandSyntaxException {
|
public Float parse(final StringReader reader) throws CommandSyntaxException {
|
||||||
final int start = reader.getCursor();
|
final int start = reader.getCursor();
|
||||||
final float result = reader.readFloat();
|
final float result = reader.readFloat();
|
||||||
if (result < minimum) {
|
if (result < minimum) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class IntegerArgumentType implements ArgumentType<Integer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Integer parse(final StringReader reader) throws CommandSyntaxException {
|
public Integer parse(final StringReader reader) throws CommandSyntaxException {
|
||||||
final int start = reader.getCursor();
|
final int start = reader.getCursor();
|
||||||
final int result = reader.readInt();
|
final int result = reader.readInt();
|
||||||
if (result < minimum) {
|
if (result < minimum) {
|
||||||
|
@ -84,4 +84,9 @@ public class IntegerArgumentType implements ArgumentType<Integer> {
|
||||||
return "integer(" + minimum + ", " + maximum + ")";
|
return "integer(" + minimum + ", " + maximum + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<String> getExamples() {
|
||||||
|
return EXAMPLES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ package com.mojang.brigadier.arguments;
|
||||||
|
|
||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.context.CommandContext;
|
import com.mojang.brigadier.context.CommandContext;
|
||||||
import com.mojang.brigadier.context.CommandContextBuilder;
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -39,7 +38,7 @@ public class StringArgumentType implements ArgumentType<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> String parse(final StringReader reader) throws CommandSyntaxException {
|
public String parse(final StringReader reader) throws CommandSyntaxException {
|
||||||
if (type == StringType.GREEDY_PHRASE) {
|
if (type == StringType.GREEDY_PHRASE) {
|
||||||
final String text = reader.getRemaining();
|
final String text = reader.getRemaining();
|
||||||
reader.setCursor(reader.getTotalLength());
|
reader.setCursor(reader.getTotalLength());
|
||||||
|
|
Loading…
Reference in a new issue