mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
commanding-pipeline diff
This commit is contained in:
@ -15,7 +15,6 @@ import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.command.ActorAuthorizer;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -24,7 +23,7 @@ import java.util.Map;
|
||||
public class DefaultTransformParser extends FaweParser<ResettableExtent> {
|
||||
|
||||
public DefaultTransformParser(WorldEdit worldEdit) {
|
||||
super(worldEdit, ResettableExtent.class);
|
||||
super(worldEdit);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,7 +53,7 @@ public class DefaultTransformParser extends FaweParser<ResettableExtent> {
|
||||
List<String> args = entry.getValue();
|
||||
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
|
||||
try {
|
||||
transform = Iterables.getFirst(parse(cmdArgs, actor), null);
|
||||
transform = parse(cmdArgs, actor);
|
||||
} catch (SuggestInputParseException rethrow) {
|
||||
throw rethrow;
|
||||
} catch (Throwable e) {
|
||||
|
@ -19,17 +19,23 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser;
|
||||
|
||||
import com.boydti.fawe.command.SuggestInputParseException;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.boydti.fawe.jnbt.JSON2NBT;
|
||||
import com.boydti.fawe.jnbt.NBTException;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.NotABlockException;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
|
||||
import com.sk89q.worldedit.blocks.SignBlock;
|
||||
import com.sk89q.worldedit.blocks.SkullBlock;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
import com.sk89q.worldedit.blocks.metadata.MobType;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.input.DisallowedUsageException;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -37,6 +43,8 @@ import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.extent.inventory.SlottableBlockBag;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
@ -49,12 +57,11 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.block.FuzzyBlockState;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import java.util.HashMap;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
@ -104,8 +111,6 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] EMPTY_STRING_ARRAY = {};
|
||||
|
||||
/**
|
||||
* Backwards compatibility for wool colours in block syntax.
|
||||
*
|
||||
@ -157,75 +162,8 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<Property<?>, Object> parseProperties(BlockType type, String[] stateProperties, ParserContext context) throws NoMatchException {
|
||||
Map<Property<?>, Object> blockStates = new HashMap<>();
|
||||
|
||||
if (stateProperties.length > 0) { // Block data not yet detected
|
||||
// Parse the block data (optional)
|
||||
for (String parseableData : stateProperties) {
|
||||
try {
|
||||
String[] parts = parseableData.split("=");
|
||||
if (parts.length != 2) {
|
||||
throw new NoMatchException("Bad state format in " + parseableData);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Property<Object> propertyKey = (Property<Object>) type.getPropertyMap().get(parts[0]);
|
||||
if (propertyKey == null) {
|
||||
if (context.getActor() != null) {
|
||||
throw new NoMatchException("Unknown property " + parts[0] + " for block " + type.getId());
|
||||
} else {
|
||||
WorldEdit.logger.warn("Unknown property " + parts[0] + " for block " + type.getId());
|
||||
}
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
if (blockStates.containsKey(propertyKey)) {
|
||||
throw new NoMatchException("Duplicate property " + parts[0]);
|
||||
}
|
||||
Object value;
|
||||
try {
|
||||
value = propertyKey.getValueFor(parts[1]);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]);
|
||||
}
|
||||
|
||||
blockStates.put(propertyKey, value);
|
||||
} catch (NoMatchException e) {
|
||||
throw e; // Pass-through
|
||||
} catch (Exception e) {
|
||||
WorldEdit.logger.warn("Unknown state '" + parseableData + "'", e);
|
||||
throw new NoMatchException("Unknown state '" + parseableData + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return blockStates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
final int idx = input.lastIndexOf('[');
|
||||
if (idx < 0) {
|
||||
return SuggestionHelper.getNamespacedRegistrySuggestions(BlockType.REGISTRY, input);
|
||||
}
|
||||
String blockType = input.substring(0, idx);
|
||||
BlockType type = BlockTypes.get(blockType.toLowerCase(Locale.ROOT));
|
||||
if (type == null) {
|
||||
return Stream.empty();
|
||||
}
|
||||
|
||||
String props = input.substring(idx + 1);
|
||||
if (props.isEmpty()) {
|
||||
return type.getProperties().stream().map(p -> input + p.getName() + "=");
|
||||
}
|
||||
|
||||
return SuggestionHelper.getBlockPropertySuggestions(blockType, props);
|
||||
}
|
||||
|
||||
private BaseBlock parseLogic(String input, ParserContext context) throws InputParseException {
|
||||
BlockType blockType = null;
|
||||
Map<Property<?>, Object> blockStates = new HashMap<>();
|
||||
String[] blockAndExtraData = input.trim().split("\\|");
|
||||
String[] blockAndExtraData = input.trim().split("\\|", 2);
|
||||
blockAndExtraData[0] = woolMapper(blockAndExtraData[0]);
|
||||
|
||||
BlockState state = null;
|
||||
@ -238,16 +176,28 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
throw new InputParseException("Invalid colon.");
|
||||
} else if (split.length == 1) {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]));
|
||||
} else if (MathMan.isInteger(split[0])) {
|
||||
int id = Integer.parseInt(split[0]);
|
||||
int data = Integer.parseInt(split[1]);
|
||||
if (data < 0 || data >= 16) {
|
||||
throw new InputParseException("Invalid data " + data);
|
||||
}
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
|
||||
} else {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
|
||||
BlockType type = BlockTypes.get(split[0].toLowerCase(Locale.ROOT));
|
||||
if (type != null) {
|
||||
int data = Integer.parseInt(split[1]);
|
||||
if (data < 0 || data >= 16) {
|
||||
throw new InputParseException("Invalid data " + data);
|
||||
}
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(type.getLegacyCombinedId() >> 4, data);
|
||||
}
|
||||
}
|
||||
if (state != null) {
|
||||
blockType = state.getBlockType();
|
||||
}
|
||||
} catch (NumberFormatException ignored) {
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
CompoundTag nbt = null;
|
||||
if (state == null) {
|
||||
String typeString;
|
||||
String stateString = null;
|
||||
@ -256,101 +206,102 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
typeString = blockAndExtraData[0];
|
||||
} else {
|
||||
typeString = blockAndExtraData[0].substring(0, stateStart);
|
||||
if (stateStart + 1 >= blockAndExtraData[0].length()) {
|
||||
throw new InputParseException("Invalid format. Hanging bracket @ " + stateStart + ".");
|
||||
}
|
||||
int stateEnd = blockAndExtraData[0].lastIndexOf(']');
|
||||
if (stateEnd < 0) {
|
||||
throw new InputParseException("Invalid format. Unclosed property.");
|
||||
}
|
||||
stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1);
|
||||
}
|
||||
if (typeString.isEmpty()) {
|
||||
throw new InputParseException("Invalid format");
|
||||
}
|
||||
String[] stateProperties = EMPTY_STRING_ARRAY;
|
||||
if (stateString != null) {
|
||||
stateProperties = stateString.split(",");
|
||||
}
|
||||
|
||||
if ("hand".equalsIgnoreCase(typeString)) {
|
||||
// Get the block type from the item in the user's hand.
|
||||
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND);
|
||||
if (blockInHand.getClass() != BaseBlock.class) {
|
||||
return blockInHand;
|
||||
}
|
||||
|
||||
blockType = blockInHand.getBlockType();
|
||||
blockStates.putAll(blockInHand.getStates());
|
||||
} else if ("offhand".equalsIgnoreCase(typeString)) {
|
||||
// Get the block type from the item in the user's off hand.
|
||||
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND);
|
||||
if (blockInHand.getClass() != BaseBlock.class) {
|
||||
return blockInHand;
|
||||
}
|
||||
|
||||
blockType = blockInHand.getBlockType();
|
||||
blockStates.putAll(blockInHand.getStates());
|
||||
} else if ("pos1".equalsIgnoreCase(typeString)) {
|
||||
// PosX
|
||||
if (typeString.matches("pos[0-9]+")) {
|
||||
int index = Integer.parseInt(typeString.replaceAll("[a-z]+", ""));
|
||||
// Get the block type from the "primary position"
|
||||
final World world = context.requireWorld();
|
||||
final BlockVector3 primaryPosition;
|
||||
try {
|
||||
primaryPosition = context.requireSession().getRegionSelector(world).getPrimaryPosition();
|
||||
primaryPosition = context.requireSession().getRegionSelector(world).getVertices().get(index - 1);
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new InputParseException("Your selection is not complete.");
|
||||
}
|
||||
final BlockState blockInHand = world.getBlock(primaryPosition);
|
||||
|
||||
blockType = blockInHand.getBlockType();
|
||||
blockStates.putAll(blockInHand.getStates());
|
||||
state = world.getBlock(primaryPosition);
|
||||
} else {
|
||||
// Attempt to lookup a block from ID or name.
|
||||
blockType = BlockTypes.get(typeString.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
if ("hand".equalsIgnoreCase(typeString)) {
|
||||
// Get the block type from the item in the user's hand.
|
||||
BaseBlock block = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND);
|
||||
state = block.toBlockState();
|
||||
nbt = block.getNbtData();
|
||||
} else if ("offhand".equalsIgnoreCase(typeString)) {
|
||||
// Get the block type from the item in the user's off hand.
|
||||
BaseBlock block = getBlockInHand(context.requireActor(), HandSide.OFF_HAND);
|
||||
state = block.toBlockState();
|
||||
nbt = block.getNbtData();
|
||||
} else if (typeString.matches("slot[0-9]+")) {
|
||||
int slot = Integer.parseInt(typeString.substring(4)) - 1;
|
||||
Actor actor = context.requireActor();
|
||||
if (!(actor instanceof Player)) {
|
||||
throw new InputParseException("The user is not a player!");
|
||||
}
|
||||
Player player = (Player) actor;
|
||||
BlockBag bag = player.getInventoryBlockBag();
|
||||
if (bag == null || !(bag instanceof SlottableBlockBag)) {
|
||||
throw new InputParseException("Unsupported!");
|
||||
}
|
||||
SlottableBlockBag slottable = (SlottableBlockBag) bag;
|
||||
BaseItem item = slottable.getItem(slot);
|
||||
|
||||
if (blockType == null) {
|
||||
throw new NoMatchException("Does not match a valid block type: '" + input + "'");
|
||||
}
|
||||
if (!item.getType().hasBlockType()) {
|
||||
throw new InputParseException("You're not holding a block!");
|
||||
}
|
||||
state = item.getType().getBlockType().getDefaultState();
|
||||
nbt = item.getNbtData();
|
||||
} else {
|
||||
BlockType type = BlockTypes.parse(typeString.toLowerCase(Locale.ROOT));
|
||||
|
||||
blockStates.putAll(parseProperties(blockType, stateProperties, context));
|
||||
|
||||
if (context.isPreferringWildcard()) {
|
||||
FuzzyBlockState.Builder fuzzyBuilder = FuzzyBlockState.builder();
|
||||
fuzzyBuilder.type(blockType);
|
||||
for (Map.Entry<Property<?>, Object> blockState : blockStates.entrySet()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Property<Object> objProp = (Property<Object>) blockState.getKey();
|
||||
fuzzyBuilder.withProperty(objProp, blockState.getValue());
|
||||
if (type != null) {
|
||||
state = type.getDefaultState();
|
||||
}
|
||||
if (state == null) {
|
||||
throw new NoMatchException("Does not match a valid block type: '" + input + "'");
|
||||
}
|
||||
}
|
||||
state = fuzzyBuilder.build();
|
||||
} else {
|
||||
// No wildcards allowed => eliminate them. (Start with default state)
|
||||
state = blockType.getDefaultState();
|
||||
for (Map.Entry<Property<?>, Object> blockState : blockStates.entrySet()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Property<Object> objProp = (Property<Object>) blockState.getKey();
|
||||
state = state.with(objProp, blockState.getValue());
|
||||
}
|
||||
if (nbt == null) nbt = state.getNbtData();
|
||||
|
||||
if (stateString != null) {
|
||||
state = BlockState.get(state.getBlockType(), "[" + stateString + "]", state);
|
||||
if (context.isPreferringWildcard()) {
|
||||
if (stateString.isEmpty()) {
|
||||
state = new FuzzyBlockState(state);
|
||||
} else {
|
||||
BlockType type = state.getBlockType();
|
||||
FuzzyBlockState.Builder fuzzyBuilder = FuzzyBlockState.builder();
|
||||
fuzzyBuilder.type(type);
|
||||
String[] entries = stateString.split(",");
|
||||
for (String entry : entries) {
|
||||
String[] split = entry.split("=");
|
||||
String key = split[0];
|
||||
String val = split[1];
|
||||
Property<Object> prop = type.getProperty(key);
|
||||
fuzzyBuilder.withProperty(prop, prop.getValueFor(val));
|
||||
}
|
||||
state = fuzzyBuilder.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// this should be impossible but IntelliJ isn't that smart
|
||||
if (blockType == null) {
|
||||
throw new NoMatchException("Does not match a valid block type: '" + input + "'");
|
||||
|
||||
if (blockAndExtraData.length > 1 && blockAndExtraData[1].startsWith("{")) {
|
||||
String joined = StringMan.join(Arrays.copyOfRange(blockAndExtraData, 1, blockAndExtraData.length), "|");
|
||||
try {
|
||||
nbt = JSON2NBT.getTagFromJson(joined);
|
||||
} catch (NBTException e) {
|
||||
throw new NoMatchException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the item is allowed
|
||||
if (context.isRestricted()) {
|
||||
Actor actor = context.requireActor();
|
||||
if (actor != null && !actor.hasPermission("worldedit.anyblock")
|
||||
&& worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) {
|
||||
throw new DisallowedUsageException("You are not allowed to use '" + input + "'");
|
||||
}
|
||||
}
|
||||
BlockType blockType = state.getBlockType();
|
||||
|
||||
if (!context.isTryingLegacy()) {
|
||||
return state.toBaseBlock();
|
||||
}
|
||||
if (nbt != null) return validate(context, state.toBaseBlock(nbt));
|
||||
|
||||
if (blockType == BlockTypes.SIGN || blockType == BlockTypes.WALL_SIGN
|
||||
|| BlockCategories.SIGNS.contains(blockType)) {
|
||||
@ -365,17 +316,22 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
// Allow setting mob spawn type
|
||||
if (blockAndExtraData.length > 1) {
|
||||
String mobName = blockAndExtraData[1];
|
||||
EntityType ent = EntityTypes.get(mobName.toLowerCase(Locale.ROOT));
|
||||
if (ent == null) {
|
||||
throw new NoMatchException("Unknown entity type '" + mobName + "'");
|
||||
for (MobType mobType : MobType.values()) {
|
||||
if (mobType.getName().toLowerCase().equals(mobName.toLowerCase(Locale.ROOT))) {
|
||||
mobName = mobType.getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
mobName = ent.getId();
|
||||
if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) {
|
||||
throw new NoMatchException("Unknown mob type '" + mobName + "'");
|
||||
String finalMobName = mobName.toLowerCase(Locale.ROOT);
|
||||
throw new SuggestInputParseException("Unknown mob type '" + mobName + "'", mobName, () -> Stream.of(MobType.values())
|
||||
.map(m -> m.getName().toLowerCase(Locale.ROOT))
|
||||
.filter(s -> s.startsWith(finalMobName))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
return validate(context, new MobSpawnerBlock(state, mobName));
|
||||
} else {
|
||||
return validate(context, new MobSpawnerBlock(state, EntityTypes.PIG.getId()));
|
||||
return validate(context, new MobSpawnerBlock(state, MobType.PIG.getName()));
|
||||
}
|
||||
} else if (blockType == BlockTypes.PLAYER_HEAD || blockType == BlockTypes.PLAYER_WALL_HEAD) {
|
||||
// allow setting type/player/rotation
|
||||
@ -406,4 +362,4 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
return holder;
|
||||
}
|
||||
}
|
||||
}
|
@ -49,7 +49,7 @@ import java.util.stream.Stream;
|
||||
|
||||
public class DefaultMaskParser extends FaweParser<Mask> {
|
||||
public DefaultMaskParser(WorldEdit worldEdit) {
|
||||
super(worldEdit, Mask.class);
|
||||
super(worldEdit);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,7 +80,7 @@ public class DefaultMaskParser extends FaweParser<Mask> {
|
||||
List<String> args = entry.getValue();
|
||||
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
|
||||
try {
|
||||
mask = Iterables.getFirst(parse(cmdArgs, actor), null);
|
||||
mask = parse(cmdArgs, actor);
|
||||
} catch (SuggestInputParseException rethrow) {
|
||||
throw rethrow;
|
||||
} catch (Throwable e) {
|
||||
|
@ -61,8 +61,8 @@ public class ExpressionMaskParser extends InputParser<Mask> {
|
||||
exp.setEnvironment(env);
|
||||
if (context.getActor() != null) {
|
||||
SessionOwner owner = context.getActor();
|
||||
IntSupplier timeout = () -> WorldEdit.getInstance().getSessionManager().get(owner).getTimeout();
|
||||
return new ExpressionMask(exp, timeout);
|
||||
Integer timeout = WorldEdit.getInstance().getSessionManager().get(owner).getTimeout();
|
||||
return new ExpressionMask(exp, timeout::intValue);
|
||||
}
|
||||
return new ExpressionMask(exp);
|
||||
} catch (ExpressionException e) {
|
||||
|
@ -21,27 +21,22 @@ package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.command.FaweParser;
|
||||
import com.boydti.fawe.command.SuggestInputParseException;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.random.TrueRandom;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.sk89q.minecraft.util.commands.CommandException;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
//import com.sk89q.worldedit.command.PatternCommands;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.command.ActorAuthorizer;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -49,7 +44,7 @@ import java.util.stream.Stream;
|
||||
public class DefaultPatternParser extends FaweParser<Pattern> {
|
||||
|
||||
public DefaultPatternParser(WorldEdit worldEdit) {
|
||||
super(worldEdit, Pattern.class);
|
||||
super(worldEdit);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -77,7 +72,7 @@ public class DefaultPatternParser extends FaweParser<Pattern> {
|
||||
List<String> args = entry.getValue();
|
||||
String cmdArgs = ((args.isEmpty()) ? "" : " " + StringMan.join(args, " "));
|
||||
try {
|
||||
pattern = Iterables.getFirst(parse(cmdArgs, actor), null);
|
||||
pattern = parse(cmdArgs, actor);
|
||||
} catch (SuggestInputParseException rethrow) {
|
||||
throw rethrow;
|
||||
} catch (Throwable e) {
|
||||
|
Reference in New Issue
Block a user