Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-09 13:00:05 +01:00
Catch pattern syntax
Dieser Commit ist enthalten in:
Ursprung
4ffb9bce6c
Commit
ebd27781a7
@ -24,6 +24,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.regex.PatternSyntaxException;
|
||||||
|
|
||||||
public class DefaultMaskParser extends FaweParser<Mask> {
|
public class DefaultMaskParser extends FaweParser<Mask> {
|
||||||
private final Dispatcher dispatcher;
|
private final Dispatcher dispatcher;
|
||||||
@ -115,6 +116,7 @@ public class DefaultMaskParser extends FaweParser<Mask> {
|
|||||||
mask = parseFromInput(command.substring(1, end == -1 ? command.length() : end), context);
|
mask = parseFromInput(command.substring(1, end == -1 ? command.length() : end), context);
|
||||||
} else {
|
} else {
|
||||||
List<String> entries = entry.getValue();
|
List<String> entries = entry.getValue();
|
||||||
|
try {
|
||||||
BlockMaskBuilder builder = new BlockMaskBuilder().addRegex(pe.full);
|
BlockMaskBuilder builder = new BlockMaskBuilder().addRegex(pe.full);
|
||||||
if (builder.isEmpty()) {
|
if (builder.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
@ -127,6 +129,9 @@ public class DefaultMaskParser extends FaweParser<Mask> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mask = builder.build(extent);
|
mask = builder.build(extent);
|
||||||
|
} catch (PatternSyntaxException regex) {
|
||||||
|
throw new InputParseException(regex.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren