Expose information about the built-in arguments (bounds or type)
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import groovy.io.FileType
|
|||||||
apply plugin: 'java-library'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
version = '0.1.8'
|
version = '0.1.9'
|
||||||
group = 'com.mojang'
|
group = 'com.mojang'
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ public class FloatArgumentType implements ArgumentType<Float> {
|
|||||||
return context.getArgument(name, Float.class);
|
return context.getArgument(name, Float.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getMinimum() {
|
||||||
|
return minimum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMaximum() {
|
||||||
|
return maximum;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Float parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
public <S> Float parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
||||||
final int start = reader.getCursor();
|
final int start = reader.getCursor();
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ public class IntegerArgumentType implements ArgumentType<Integer> {
|
|||||||
return context.getArgument(name, int.class);
|
return context.getArgument(name, int.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMinimum() {
|
||||||
|
return minimum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaximum() {
|
||||||
|
return maximum;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> Integer parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
public <S> Integer parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
||||||
final int start = reader.getCursor();
|
final int start = reader.getCursor();
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ public class StringArgumentType implements ArgumentType<String> {
|
|||||||
return context.getArgument(name, String.class);
|
return context.getArgument(name, String.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StringType getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> String parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
public <S> String parse(final StringReader reader, final CommandContextBuilder<S> contextBuilder) throws CommandSyntaxException {
|
||||||
if (type == StringType.GREEDY_PHRASE) {
|
if (type == StringType.GREEDY_PHRASE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user