3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-03 01:50:07 +01:00

Clipboard offset pattern is now #copy@[x,y,z].

Since the parsers were changed around, unescaped commas are parsed as
separate blocks now.
Dieser Commit ist enthalten in:
wizjany 2019-03-27 23:36:59 -04:00
Ursprung 74bff83e38
Commit d7d2d03ee8

Datei anzeigen

@ -55,15 +55,20 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
BlockVector3 offset = BlockVector3.ZERO;
if (offsetParts.length == 2) {
String[] offsetSplit = offsetParts[1].split(",");
String coords = offsetParts[1];
if (coords.length() < 7 // min length of `[x,y,z]`
|| coords.charAt(0) != '[' || coords.charAt(coords.length() - 1) != ']') {
throw new InputParseException("Offset specified with @ but no offset given. Use '#copy@[x,y,z]'.");
}
String[] offsetSplit = coords.substring(1, coords.length() - 1).split(",");
if (offsetSplit.length != 3) {
throw new InputParseException("Clipboard offset needs x,y,z coordinates.");
}
offset = BlockVector3.at(
Integer.valueOf(offsetSplit[0]),
Integer.valueOf(offsetSplit[1]),
Integer.valueOf(offsetSplit[2])
);
Integer.valueOf(offsetSplit[0]),
Integer.valueOf(offsetSplit[1]),
Integer.valueOf(offsetSplit[2])
);
}
if (session != null) {