mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Added methods to CommandContext to get slices excluding flags et al.
This commit is contained in:
parent
98e466d371
commit
cd5f832adf
@ -204,6 +204,18 @@ public class CommandContext {
|
||||
return slice;
|
||||
}
|
||||
|
||||
public String[] getParsedSlice(int index) {
|
||||
String[] slice = new String[parsedArgs.size() - index];
|
||||
System.arraycopy(parsedArgs.toArray(new String[parsedArgs.size()]), index, slice, 0, parsedArgs.size() - index);
|
||||
return slice;
|
||||
}
|
||||
|
||||
public String[] getParsedPaddedSlice(int index, int padding) {
|
||||
String[] slice = new String[parsedArgs.size() - index + padding];
|
||||
System.arraycopy(parsedArgs.toArray(new String[parsedArgs.size()]), index, slice, padding, parsedArgs.size() - index);
|
||||
return slice;
|
||||
}
|
||||
|
||||
public boolean hasFlag(char ch) {
|
||||
return booleanFlags.contains(ch) || valueFlags.containsKey(ch);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user