fix: do not error when attempting to parse "|" as a pattern (#2625)

This commit is contained in:
Jordan 2024-03-17 13:15:28 +01:00 committed by GitHub
parent 0db8154546
commit 2d0a3e6081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,6 +64,7 @@ import com.sk89q.worldedit.world.entity.EntityType;
import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
@ -337,9 +338,10 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
return SuggestionHelper.getBlockPropertySuggestions(blockType, props);
}
@Nonnull
private BaseBlock parseLogic(String input, ParserContext context) throws InputParseException {
//FAWE start
String[] blockAndExtraData = input.trim().split("\\|");
String[] blockAndExtraData = input.trim().split("(?<!^)\\|");
blockAndExtraData[0] = woolMapper(blockAndExtraData[0]);
Map<Property<?>, Object> blockStates = new HashMap<>();
//FAWE end