mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Fixed /removenear not taking a default size argument.
This commit is contained in:
parent
6b996435e3
commit
6979704661
@ -61,6 +61,10 @@ public boolean matches(String command) {
|
||||
public String getString(int index) {
|
||||
return args[index + 1];
|
||||
}
|
||||
|
||||
public String getString(int index, String def) {
|
||||
return index + 1 < args.length ? args[index + 1] : def;
|
||||
}
|
||||
|
||||
public String getJoinedStrings(int initialIndex) {
|
||||
initialIndex = initialIndex + 1;
|
||||
@ -75,10 +79,18 @@ public int getInteger(int index) throws NumberFormatException {
|
||||
return Integer.parseInt(args[index + 1]);
|
||||
}
|
||||
|
||||
public int getInteger(int index, int def) throws NumberFormatException {
|
||||
return index + 1 < args.length ? Integer.parseInt(args[index + 1]) : def;
|
||||
}
|
||||
|
||||
public double getDouble(int index) throws NumberFormatException {
|
||||
return Double.parseDouble(args[index + 1]);
|
||||
}
|
||||
|
||||
public double getDouble(int index, double def) throws NumberFormatException {
|
||||
return index + 1 < args.length ? Double.parseDouble(args[index + 1]) : def;
|
||||
}
|
||||
|
||||
public String[] getSlice(int index) {
|
||||
String[] slice = new String[args.length - index];
|
||||
System.arraycopy(args, index, slice, 0, args.length - index);
|
||||
|
@ -204,7 +204,7 @@ public static void removeNear(CommandContext args, WorldEdit we,
|
||||
throws WorldEditException {
|
||||
|
||||
BaseBlock block = we.getBlock(player, args.getString(0), true);
|
||||
int size = Math.max(1, args.getInteger(1));
|
||||
int size = Math.max(1, args.getInteger(1, 50));
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
int affected = editSession.removeNear(
|
||||
|
Loading…
Reference in New Issue
Block a user