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