Skip to content

Commit

Permalink
Expose information about the built-in arguments (bounds or type)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed Nov 13, 2017
1 parent fdff548 commit 6b57d5f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public static float getFloat(final CommandContext<?> context, final String name)
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public static int getInteger(final CommandContext<?> context, final String name)
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public static String getString(final CommandContext<?> context, final String nam
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) {
Expand Down

0 comments on commit 6b57d5f

Please sign in to comment.