mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 19:26:49 +00:00
GiveCommand: fix edge case with unspaced multiple args (#539)
Co-authored-by: AnimeGitB <AnimeGitB@bigblueball.in>
This commit is contained in:
parent
b61672e046
commit
775f4cb7c1
@ -20,7 +20,7 @@ import java.util.regex.Matcher;
|
|||||||
public final class GiveCommand implements CommandHandler {
|
public final class GiveCommand implements CommandHandler {
|
||||||
Pattern lvlRegex = Pattern.compile("l(?:vl?)?(\\d+)"); // Java is a joke of a proglang that doesn't have raw string literals
|
Pattern lvlRegex = Pattern.compile("l(?:vl?)?(\\d+)"); // Java is a joke of a proglang that doesn't have raw string literals
|
||||||
Pattern refineRegex = Pattern.compile("r(\\d+)");
|
Pattern refineRegex = Pattern.compile("r(\\d+)");
|
||||||
Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x))");
|
Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x)(?!x\\d))");
|
||||||
|
|
||||||
private int matchIntOrNeg(Pattern pattern, String arg) {
|
private int matchIntOrNeg(Pattern pattern, String arg) {
|
||||||
Matcher match = pattern.matcher(arg);
|
Matcher match = pattern.matcher(arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user