mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 02:18:34 +00:00
Copy paste/merge FAWE classes to this WorldEdit fork
- so certain people can look at the diff and complain about my sloppy code :( Signed-off-by: Jesse Boyd <jessepaleg@gmail.com>
This commit is contained in:
@ -19,13 +19,15 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@ -60,8 +62,7 @@ public class BlockFactory extends AbstractFactory<BlockStateHolder> {
|
||||
*/
|
||||
public Set<BlockStateHolder> parseFromListInput(String input, ParserContext context) throws InputParseException {
|
||||
Set<BlockStateHolder> blocks = new HashSet<>();
|
||||
String[] splits = input.split(",");
|
||||
for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) {
|
||||
for (String token : input.split(",")) {
|
||||
blocks.add(parseFromInput(token, context));
|
||||
}
|
||||
return blocks;
|
||||
|
@ -19,12 +19,15 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.NotABlockException;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
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.*;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.blocks.MobSpawnerBlock;
|
||||
import com.sk89q.worldedit.blocks.SignBlock;
|
||||
import com.sk89q.worldedit.blocks.SkullBlock;
|
||||
@ -36,25 +39,24 @@ 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.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
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.registry.LegacyMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Parses block input strings.
|
||||
*/
|
||||
class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
public class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
|
||||
protected DefaultBlockParser(WorldEdit worldEdit) {
|
||||
public DefaultBlockParser(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
}
|
||||
|
||||
@ -72,7 +74,6 @@ class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateHolder parseFromInput(String input, ParserContext context)
|
||||
throws InputParseException {
|
||||
String originalInput = input;
|
||||
@ -148,47 +149,12 @@ class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
}
|
||||
}
|
||||
|
||||
private static BlockState applyProperties(BlockState state, String[] stateProperties) throws NoMatchException {
|
||||
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);
|
||||
}
|
||||
|
||||
Property propertyKey = state.getBlockType().getPropertyMap().get(parts[0]);
|
||||
if (propertyKey == null) {
|
||||
throw new NoMatchException("Unknown state " + parts[0] + " for block " + state.getBlockType().getName());
|
||||
}
|
||||
Object value;
|
||||
try {
|
||||
value = propertyKey.getValueFor(parts[1]);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new NoMatchException("Unknown value " + parts[1] + " for state " + parts[0]);
|
||||
}
|
||||
|
||||
state = state.with(propertyKey, value);
|
||||
} catch (NoMatchException e) {
|
||||
throw e; // Pass-through
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new NoMatchException("Unknown state '" + parseableData + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
private BlockStateHolder 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;
|
||||
CompoundTag nbt = null;
|
||||
|
||||
// Legacy matcher
|
||||
if (context.isTryingLegacy()) {
|
||||
@ -196,14 +162,15 @@ class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
String[] split = blockAndExtraData[0].split(":");
|
||||
if (split.length == 1) {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]));
|
||||
} else {
|
||||
} else if (MathMan.isInteger(split[0])) {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
|
||||
} else {
|
||||
BlockTypes type = BlockTypes.get(split[0].toLowerCase());
|
||||
if (type != null) {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(type.getLegacyCombinedId() >> 4, Integer.parseInt(split[1]));
|
||||
}
|
||||
}
|
||||
if (state != null) {
|
||||
blockType = state.getBlockType();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
} catch (NumberFormatException ignore) {}
|
||||
}
|
||||
|
||||
if (state == null) {
|
||||
@ -219,73 +186,85 @@ class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
if (typeString == null || 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 = 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 = 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 BlockVector primaryPosition;
|
||||
final Vector primaryPosition;
|
||||
try {
|
||||
primaryPosition = context.requireSession().getRegionSelector(world).getPrimaryPosition();
|
||||
primaryPosition = context.requireSession().getRegionSelector(world).getVerticies().get(index - 1);
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new InputParseException("Your selection is not complete.");
|
||||
}
|
||||
final BlockState blockInHand = world.getBlock(primaryPosition);
|
||||
state = world.getBlock(primaryPosition);
|
||||
} else if (typeString.equalsIgnoreCase("hand")) {
|
||||
// Get the block type from the item in the user's hand.
|
||||
state = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND);
|
||||
} else if (typeString.equalsIgnoreCase("offhand")) {
|
||||
// Get the block type from the item in the user's off hand.
|
||||
state = getBlockInHand(context.requireActor(), HandSide.OFF_HAND);
|
||||
} 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);
|
||||
|
||||
blockType = blockInHand.getBlockType();
|
||||
blockStates = blockInHand.getStates();
|
||||
if (!item.getType().hasBlockType()) {
|
||||
throw new InputParseException("You're not holding a block!");
|
||||
}
|
||||
state = item.getType().getBlockType().getDefaultState();
|
||||
nbt = item.getNbtData();
|
||||
} else {
|
||||
// Attempt to lookup a block from ID or name.
|
||||
blockType = BlockTypes.get(typeString.toLowerCase());
|
||||
state = BlockTypes.parse(typeString.toLowerCase()).getDefaultState();
|
||||
|
||||
if (blockType == null) {
|
||||
if (state == null) {
|
||||
throw new NoMatchException("Does not match a valid block type: '" + input + "'");
|
||||
}
|
||||
}
|
||||
if (nbt == null) nbt = state.getNbtData();
|
||||
|
||||
if (!context.isPreferringWildcard()) {
|
||||
// No wildcards allowed => eliminate them. (Start with default state)
|
||||
state = blockType.getDefaultState();
|
||||
} else {
|
||||
state = blockType.getDefaultState().toFuzzy();
|
||||
for (Map.Entry<Property<?>, Object> blockState : blockStates.entrySet()) {
|
||||
state = state.with((Property) blockState.getKey(), blockState.getValue());
|
||||
}
|
||||
if (stateString != null) {
|
||||
state = BlockState.get(state.getBlockType(), "[" + stateString + "]", state.getInternalPropertiesId());
|
||||
}
|
||||
}
|
||||
|
||||
state = applyProperties(state, stateProperties);
|
||||
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
|
||||
BlockTypes blockType = state.getBlockType();
|
||||
|
||||
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 + "'");
|
||||
if (actor != null) {
|
||||
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) {
|
||||
throw new DisallowedUsageException("You are not allowed to use '" + input + "'");
|
||||
}
|
||||
if (nbt != null) {
|
||||
if (!actor.hasPermission("worldedit.anyblock")) {
|
||||
throw new DisallowedUsageException("You are not allowed to nbt'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nbt != null) return new BaseBlock(state, nbt);
|
||||
|
||||
if (blockType == BlockTypes.SIGN || blockType == BlockTypes.WALL_SIGN) {
|
||||
// Allow special sign text syntax
|
||||
String[] text = new String[4];
|
||||
@ -324,5 +303,4 @@ class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,173 +1,169 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.boydti.fawe.command.FaweParser;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.command.MaskCommands;
|
||||
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.Capability;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.BiomeMask2D;
|
||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
||||
import com.sk89q.worldedit.function.mask.ExpressionMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.MaskIntersection;
|
||||
import com.sk89q.worldedit.function.mask.Masks;
|
||||
import com.sk89q.worldedit.function.mask.NoiseFilter;
|
||||
import com.sk89q.worldedit.function.mask.OffsetMask;
|
||||
import com.sk89q.worldedit.function.mask.RegionMask;
|
||||
import com.sk89q.worldedit.function.mask.SolidBlockMask;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.math.noise.RandomNoise;
|
||||
import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
||||
import com.sk89q.worldedit.function.mask.*;
|
||||
import com.sk89q.worldedit.internal.command.ActorAuthorizer;
|
||||
import com.sk89q.worldedit.internal.command.WorldEditBinding;
|
||||
import com.sk89q.worldedit.session.request.Request;
|
||||
import com.sk89q.worldedit.session.request.RequestSelection;
|
||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
||||
import com.sk89q.worldedit.world.biome.Biomes;
|
||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||
import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.util.command.SimpleDispatcher;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParametricBuilder;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Parses mask input strings.
|
||||
*/
|
||||
class DefaultMaskParser extends InputParser<Mask> {
|
||||
public class DefaultMaskParser extends FaweParser<Mask> {
|
||||
private final Dispatcher dispatcher;
|
||||
private final Pattern INTERSECTION_PATTERN = Pattern.compile("[&|;]+(?![^\\[]*\\])");
|
||||
|
||||
protected DefaultMaskParser(WorldEdit worldEdit) {
|
||||
public DefaultMaskParser(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
this.dispatcher = new SimpleDispatcher();
|
||||
this.register(new MaskCommands(worldEdit));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dispatcher getDispatcher() {
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
public void register(Object clazz) {
|
||||
ParametricBuilder builder = new ParametricBuilder();
|
||||
builder.setAuthorizer(new ActorAuthorizer());
|
||||
builder.addBinding(new WorldEditBinding(worldEdit));
|
||||
builder.registerMethodsAsCommands(dispatcher, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
List<Mask> masks = new ArrayList<>();
|
||||
if (input.isEmpty()) return null;
|
||||
Extent extent = Request.request().getExtent();
|
||||
if (extent == null) extent = context.getExtent();
|
||||
// List<Mask> intersection = new ArrayList<>();
|
||||
// List<Mask> union = new ArrayList<>();
|
||||
List<List<Mask>> masks = new ArrayList<>();
|
||||
masks.add(new ArrayList<>());
|
||||
|
||||
for (String component : input.split(" ")) {
|
||||
if (component.isEmpty()) {
|
||||
continue;
|
||||
final CommandLocals locals = new CommandLocals();
|
||||
Actor actor = context != null ? context.getActor() : null;
|
||||
if (actor != null) {
|
||||
locals.put(Actor.class, actor);
|
||||
}
|
||||
//
|
||||
try {
|
||||
List<Map.Entry<ParseEntry, List<String>>> parsed = parse(input);
|
||||
for (Map.Entry<ParseEntry, List<String>> entry : parsed) {
|
||||
ParseEntry pe = entry.getKey();
|
||||
String command = pe.input;
|
||||
Mask mask = null;
|
||||
if (command.isEmpty()) {
|
||||
mask = parseFromInput(StringMan.join(entry.getValue(), ','), context);
|
||||
} else if (dispatcher.get(command) == null) {
|
||||
// Legacy patterns
|
||||
char char0 = command.charAt(0);
|
||||
boolean charMask = input.length() > 1 && input.charAt(1) != '[';
|
||||
if (charMask && input.charAt(0) == '=') {
|
||||
return parseFromInput(char0 + "[" + input.substring(1) + "]", context);
|
||||
}
|
||||
if (mask == null) {
|
||||
// Legacy syntax
|
||||
if (charMask) {
|
||||
switch (char0) {
|
||||
case '\\': //
|
||||
case '/': //
|
||||
case '{': //
|
||||
case '$': //
|
||||
case '%': {
|
||||
command = command.substring(1);
|
||||
String value = command + ((entry.getValue().isEmpty()) ? "" : "[" + StringMan.join(entry.getValue(), "][") + "]");
|
||||
if (value.contains(":")) {
|
||||
if (value.charAt(0) == ':') value.replaceFirst(":", "");
|
||||
value = value.replaceAll(":", "][");
|
||||
}
|
||||
mask = parseFromInput(char0 + "[" + value + "]", context);
|
||||
break;
|
||||
}
|
||||
case '|':
|
||||
case '~':
|
||||
case '<':
|
||||
case '>':
|
||||
case '!':
|
||||
input = input.substring(input.indexOf(char0) + 1);
|
||||
mask = parseFromInput(char0 + "[" + input + "]", context);
|
||||
if (actor != null) {
|
||||
BBC.COMMAND_CLARIFYING_BRACKET.send(actor, char0 + "[" + input + "]");
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
}
|
||||
if (mask == null) {
|
||||
if (command.startsWith("[")) {
|
||||
int end = command.lastIndexOf(']');
|
||||
mask = parseFromInput(command.substring(1, end == -1 ? command.length() : end), context);
|
||||
} else {
|
||||
List<String> entries = entry.getValue();
|
||||
BlockMaskBuilder builder = new BlockMaskBuilder().addRegex(pe.full);
|
||||
if (builder.isEmpty()) {
|
||||
try {
|
||||
context.setPreferringWildcard(true);
|
||||
context.setRestricted(false);
|
||||
BlockStateHolder block = worldEdit.getBlockFactory().parseFromInput(pe.full, context);
|
||||
builder.add(block);
|
||||
} catch (NoMatchException e) {
|
||||
throw new NoMatchException(e.getMessage() + " See: //masks");
|
||||
}
|
||||
}
|
||||
mask = builder.build(extent);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> args = entry.getValue();
|
||||
if (!args.isEmpty()) {
|
||||
command += " " + StringMan.join(args, " ");
|
||||
}
|
||||
mask = (Mask) dispatcher.call(command, locals, new String[0]);
|
||||
}
|
||||
if (pe.and) {
|
||||
masks.add(new ArrayList<>());
|
||||
}
|
||||
masks.get(masks.size() - 1).add(mask);
|
||||
}
|
||||
|
||||
Mask current = getBlockMaskComponent(masks, component, context);
|
||||
|
||||
masks.add(current);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new InputParseException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
switch (masks.size()) {
|
||||
case 0:
|
||||
return null;
|
||||
|
||||
case 1:
|
||||
return masks.get(0);
|
||||
|
||||
default:
|
||||
return new MaskIntersection(masks);
|
||||
List<Mask> maskUnions = new ArrayList<>();
|
||||
for (List<Mask> maskList : masks) {
|
||||
if (maskList.size() == 1) {
|
||||
maskUnions.add(maskList.get(0));
|
||||
} else if (maskList.size() != 0) {
|
||||
maskUnions.add(new MaskUnion(maskList));
|
||||
}
|
||||
}
|
||||
if (maskUnions.size() == 1) {
|
||||
return maskUnions.get(0);
|
||||
} else if (maskUnions.size() != 0) {
|
||||
return new MaskIntersection(maskUnions);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Mask getBlockMaskComponent(List<Mask> masks, String component, ParserContext context) throws InputParseException {
|
||||
Extent extent = Request.request().getEditSession();
|
||||
|
||||
final char firstChar = component.charAt(0);
|
||||
switch (firstChar) {
|
||||
case '#':
|
||||
if (component.equalsIgnoreCase("#existing")) {
|
||||
return new ExistingBlockMask(extent);
|
||||
} else if (component.equalsIgnoreCase("#solid")) {
|
||||
return new SolidBlockMask(extent);
|
||||
} else if (component.equalsIgnoreCase("#dregion")
|
||||
|| component.equalsIgnoreCase("#dselection")
|
||||
|| component.equalsIgnoreCase("#dsel")) {
|
||||
return new RegionMask(new RequestSelection());
|
||||
} else if (component.equalsIgnoreCase("#selection")
|
||||
|| component.equalsIgnoreCase("#region")
|
||||
|| component.equalsIgnoreCase("#sel")) {
|
||||
try {
|
||||
return new RegionMask(context.requireSession().getSelection(context.requireWorld()).clone());
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new InputParseException("Please make a selection first.");
|
||||
}
|
||||
} else {
|
||||
throw new NoMatchException("Unrecognized mask '" + component + "'");
|
||||
}
|
||||
|
||||
case '>':
|
||||
case '<':
|
||||
Mask submask;
|
||||
if (component.length() > 1) {
|
||||
submask = getBlockMaskComponent(masks, component.substring(1), context);
|
||||
} else {
|
||||
submask = new ExistingBlockMask(extent);
|
||||
}
|
||||
OffsetMask offsetMask = new OffsetMask(submask, new Vector(0, firstChar == '>' ? -1 : 1, 0));
|
||||
return new MaskIntersection(offsetMask, Masks.negate(submask));
|
||||
|
||||
case '$':
|
||||
Set<BaseBiome> biomes = new HashSet<>();
|
||||
String[] biomesList = component.substring(1).split(",");
|
||||
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager()
|
||||
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
|
||||
List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
|
||||
for (String biomeName : biomesList) {
|
||||
BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry);
|
||||
if (biome == null) {
|
||||
throw new InputParseException("Unknown biome '" + biomeName + "'");
|
||||
}
|
||||
biomes.add(biome);
|
||||
}
|
||||
|
||||
return Masks.asMask(new BiomeMask2D(context.requireExtent(), biomes));
|
||||
|
||||
case '%':
|
||||
int i = Integer.parseInt(component.substring(1));
|
||||
return new NoiseFilter(new RandomNoise(), ((double) i) / 100);
|
||||
|
||||
case '=':
|
||||
try {
|
||||
Expression exp = Expression.compile(component.substring(1), "x", "y", "z");
|
||||
WorldEditExpressionEnvironment env = new WorldEditExpressionEnvironment(
|
||||
Request.request().getEditSession(), Vector.ONE, Vector.ZERO);
|
||||
exp.setEnvironment(env);
|
||||
return new ExpressionMask(exp);
|
||||
} catch (ExpressionException e) {
|
||||
throw new InputParseException("Invalid expression: " + e.getMessage());
|
||||
}
|
||||
|
||||
case '!':
|
||||
if (component.length() > 1) {
|
||||
return Masks.negate(getBlockMaskComponent(masks, component.substring(1), context));
|
||||
}
|
||||
|
||||
default:
|
||||
ParserContext tempContext = new ParserContext(context);
|
||||
tempContext.setRestricted(false);
|
||||
tempContext.setPreferringWildcard(true);
|
||||
return new BlockMask(extent, worldEdit.getBlockFactory().parseFromListInput(component, tempContext));
|
||||
}
|
||||
public static Class<?> inject() {
|
||||
return DefaultMaskParser.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,152 @@
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.boydti.fawe.command.FaweParser;
|
||||
import com.boydti.fawe.object.extent.MultiTransform;
|
||||
import com.boydti.fawe.object.extent.RandomTransform;
|
||||
import com.boydti.fawe.object.extent.ResettableExtent;
|
||||
import com.boydti.fawe.object.random.TrueRandom;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.TransformCommands;
|
||||
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.command.WorldEditBinding;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.util.command.SimpleDispatcher;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParametricBuilder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class DefaultTransformParser extends FaweParser<ResettableExtent> {
|
||||
private final Pattern INTERSECTION_PATTERN = Pattern.compile("[&|;]+(?![^\\[]*\\])");
|
||||
private final Dispatcher dispatcher;
|
||||
|
||||
public DefaultTransformParser(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
this.dispatcher = new SimpleDispatcher();
|
||||
this.register(new TransformCommands(worldEdit));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dispatcher getDispatcher() {
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
public void register(Object clazz) {
|
||||
ParametricBuilder builder = new ParametricBuilder();
|
||||
builder.setAuthorizer(new ActorAuthorizer());
|
||||
builder.addBinding(new WorldEditBinding(worldEdit));
|
||||
builder.registerMethodsAsCommands(dispatcher, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResettableExtent parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
if (input.isEmpty()) return null;
|
||||
|
||||
List<Double> unionChances = new ArrayList<>();
|
||||
List<Double> intersectionChances = new ArrayList<>();
|
||||
|
||||
List<ResettableExtent> intersection = new ArrayList<>();
|
||||
List<ResettableExtent> union = new ArrayList<>();
|
||||
final CommandLocals locals = new CommandLocals();
|
||||
Actor actor = context != null ? context.getActor() : null;
|
||||
if (actor != null) {
|
||||
locals.put(Actor.class, actor);
|
||||
}
|
||||
try {
|
||||
List<Map.Entry<ParseEntry, List<String>>> parsed = parse(input);
|
||||
for (Map.Entry<ParseEntry, List<String>> entry : parsed) {
|
||||
ParseEntry pe = entry.getKey();
|
||||
String command = pe.input;
|
||||
ResettableExtent transform = null;
|
||||
double chance = 1;
|
||||
if (command.isEmpty()) {
|
||||
transform = parseFromInput(StringMan.join(entry.getValue(), ','), context);
|
||||
} else if (dispatcher.get(command) == null) {
|
||||
// Legacy syntax
|
||||
int percentIndex = command.indexOf('%');
|
||||
if (percentIndex != -1) { // Legacy percent pattern
|
||||
chance = Expression.compile(command.substring(0, percentIndex)).evaluate();
|
||||
command = command.substring(percentIndex + 1);
|
||||
if (!entry.getValue().isEmpty()) {
|
||||
if (!command.isEmpty()) command += " ";
|
||||
command += StringMan.join(entry.getValue(), " ");
|
||||
}
|
||||
transform = parseFromInput(command, context);
|
||||
} else {
|
||||
throw new NoMatchException("See: //transforms");
|
||||
}
|
||||
} else {
|
||||
List<String> args = entry.getValue();
|
||||
if (!args.isEmpty()) {
|
||||
command += " " + StringMan.join(args, " ");
|
||||
}
|
||||
transform = (ResettableExtent) dispatcher.call(command, locals, new String[0]);
|
||||
}
|
||||
if (pe.and) { // &
|
||||
intersectionChances.add(chance);
|
||||
intersection.add(transform);
|
||||
} else {
|
||||
if (!intersection.isEmpty()) {
|
||||
if (intersection.size() == 1) {
|
||||
throw new InputParseException("Error, floating &");
|
||||
}
|
||||
MultiTransform multi = new MultiTransform();
|
||||
double total = 0;
|
||||
for (int i = 0; i < intersection.size(); i++) {
|
||||
Double value = intersectionChances.get(i);
|
||||
total += value;
|
||||
multi.add(intersection.get(i), value);
|
||||
}
|
||||
union.add(multi);
|
||||
unionChances.add(total);
|
||||
intersection.clear();
|
||||
intersectionChances.clear();
|
||||
}
|
||||
unionChances.add(chance);
|
||||
union.add(transform);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
throw new InputParseException(e.getMessage(), e);
|
||||
}
|
||||
if (!intersection.isEmpty()) {
|
||||
if (intersection.size() == 1) {
|
||||
throw new InputParseException("Error, floating &");
|
||||
}
|
||||
MultiTransform multi = new MultiTransform();
|
||||
double total = 0;
|
||||
for (int i = 0; i < intersection.size(); i++) {
|
||||
Double value = intersectionChances.get(i);
|
||||
total += value;
|
||||
multi.add(intersection.get(i), value);
|
||||
}
|
||||
union.add(multi);
|
||||
unionChances.add(total);
|
||||
intersection.clear();
|
||||
intersectionChances.clear();
|
||||
}
|
||||
if (union.isEmpty()) {
|
||||
throw new NoMatchException("See: //transforms");
|
||||
} else if (union.size() == 1) {
|
||||
return union.get(0);
|
||||
} else {
|
||||
RandomTransform random = new RandomTransform(new TrueRandom());
|
||||
for (int i = 0; i < union.size(); i++) {
|
||||
random.add(union.get(i), unionChances.get(i));
|
||||
}
|
||||
return random;
|
||||
}
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return HashTagPatternParser.class;
|
||||
}
|
||||
}
|
@ -1,64 +1,141 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.EmptyClipboardException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.boydti.fawe.command.FaweParser;
|
||||
import com.boydti.fawe.object.random.TrueRandom;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
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.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.function.pattern.ClipboardPattern;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.command.ActorAuthorizer;
|
||||
import com.sk89q.worldedit.internal.command.WorldEditBinding;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.util.command.Dispatcher;
|
||||
import com.sk89q.worldedit.util.command.SimpleDispatcher;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParametricBuilder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
class HashTagPatternParser extends InputParser<Pattern> {
|
||||
public class HashTagPatternParser extends FaweParser<Pattern> {
|
||||
private final Dispatcher dispatcher;
|
||||
|
||||
HashTagPatternParser(WorldEdit worldEdit) {
|
||||
public HashTagPatternParser(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
this.dispatcher = new SimpleDispatcher();
|
||||
this.register(new PatternCommands(worldEdit));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dispatcher getDispatcher() {
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
public void register(Object clazz) {
|
||||
ParametricBuilder builder = new ParametricBuilder();
|
||||
builder.setAuthorizer(new ActorAuthorizer());
|
||||
builder.addBinding(new WorldEditBinding(worldEdit));
|
||||
builder.registerMethodsAsCommands(dispatcher, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
if (input.charAt(0) == '#') {
|
||||
if (!input.equals("#clipboard") && !input.equals("#copy")) {
|
||||
throw new InputParseException("#clipboard or #copy is acceptable for patterns starting with #");
|
||||
}
|
||||
|
||||
LocalSession session = context.requireSession();
|
||||
|
||||
if (session != null) {
|
||||
try {
|
||||
ClipboardHolder holder = session.getClipboard();
|
||||
Clipboard clipboard = holder.getClipboard();
|
||||
return new ClipboardPattern(clipboard);
|
||||
} catch (EmptyClipboardException e) {
|
||||
throw new InputParseException("To use #clipboard, please first copy something to your clipboard");
|
||||
if (input.isEmpty()) return null;
|
||||
List<Double> chances = new ArrayList<>();
|
||||
List<Pattern> patterns = new ArrayList<>();
|
||||
final CommandLocals locals = new CommandLocals();
|
||||
Actor actor = context != null ? context.getActor() : null;
|
||||
if (actor != null) {
|
||||
locals.put(Actor.class, actor);
|
||||
}
|
||||
try {
|
||||
for (Map.Entry<ParseEntry, List<String>> entry : parse(input)) {
|
||||
ParseEntry pe = entry.getKey();
|
||||
String command = pe.input;
|
||||
Pattern pattern = null;
|
||||
double chance = 1;
|
||||
if (command.isEmpty()) {
|
||||
pattern = parseFromInput(StringMan.join(entry.getValue(), ','), context);
|
||||
} else if (dispatcher.get(command) == null) {
|
||||
// Legacy patterns
|
||||
char char0 = command.charAt(0);
|
||||
boolean charMask = input.length() > 1 && input.charAt(1) != '[';
|
||||
if (charMask && input.charAt(0) == '=') {
|
||||
return parseFromInput(char0 + "[" + input.substring(1) + "]", context);
|
||||
}
|
||||
if (charMask) {
|
||||
switch (char0) {
|
||||
case '$': {
|
||||
command = command.substring(1);
|
||||
String value = command + ((entry.getValue().isEmpty()) ? "" : "[" + StringMan.join(entry.getValue(), "][") + "]");
|
||||
if (value.contains(":")) {
|
||||
if (value.charAt(0) == ':') value.replaceFirst(":", "");
|
||||
value = value.replaceAll(":", "][");
|
||||
}
|
||||
pattern = parseFromInput(char0 + "[" + value + "]", context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pattern == null) {
|
||||
if (command.startsWith("[")) {
|
||||
int end = command.lastIndexOf(']');
|
||||
pattern = parseFromInput(command.substring(1, end == -1 ? command.length() : end), context);
|
||||
} else {
|
||||
int percentIndex = command.indexOf('%');
|
||||
if (percentIndex != -1) { // Legacy percent pattern
|
||||
chance = Expression.compile(command.substring(0, percentIndex)).evaluate();
|
||||
command = command.substring(percentIndex + 1);
|
||||
if (!entry.getValue().isEmpty()) {
|
||||
if (!command.isEmpty()) command += " ";
|
||||
command += StringMan.join(entry.getValue(), " ");
|
||||
}
|
||||
pattern = parseFromInput(command, context);
|
||||
} else { // legacy block pattern
|
||||
try {
|
||||
pattern = worldEdit.getBlockFactory().parseFromInput(pe.full, context);
|
||||
} catch (NoMatchException e) {
|
||||
throw new NoMatchException(e.getMessage() + " See: //patterns");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> args = entry.getValue();
|
||||
if (!args.isEmpty()) {
|
||||
command += " " + StringMan.join(args, " ");
|
||||
}
|
||||
pattern = (Pattern) dispatcher.call(command, locals, new String[0]);
|
||||
}
|
||||
if (pattern != null) {
|
||||
patterns.add(pattern);
|
||||
chances.add(chance);
|
||||
}
|
||||
} else {
|
||||
throw new InputParseException("No session is available, so no clipboard is available");
|
||||
}
|
||||
} else {
|
||||
} catch (CommandException | ExpressionException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (patterns.isEmpty()) {
|
||||
return null;
|
||||
} else if (patterns.size() == 1) {
|
||||
return patterns.get(0);
|
||||
} else {
|
||||
RandomPattern random = new RandomPattern(new TrueRandom());
|
||||
for (int i = 0; i < patterns.size(); i++) {
|
||||
random.add(patterns.get(i), chances.get(i));
|
||||
}
|
||||
return random;
|
||||
}
|
||||
}
|
||||
|
||||
public static Class<?> inject() {
|
||||
return HashTagPatternParser.class;
|
||||
}
|
||||
}
|
||||
|
@ -19,15 +19,15 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
class RandomPatternParser extends InputParser<Pattern> {
|
||||
|
||||
@ -40,8 +40,7 @@ class RandomPatternParser extends InputParser<Pattern> {
|
||||
BlockFactory blockRegistry = worldEdit.getBlockFactory();
|
||||
RandomPattern randomPattern = new RandomPattern();
|
||||
|
||||
String[] splits = input.split(",");
|
||||
for (String token : StringUtil.parseListInQuotes(splits, ',', '[', ']')) {
|
||||
for (String token : input.split(",")) {
|
||||
BlockStateHolder block;
|
||||
|
||||
double chance;
|
||||
@ -61,7 +60,7 @@ class RandomPatternParser extends InputParser<Pattern> {
|
||||
block = blockRegistry.parseFromInput(token, context);
|
||||
}
|
||||
|
||||
randomPattern.add(new BlockPattern(block), chance);
|
||||
randomPattern.add(block, chance);
|
||||
}
|
||||
|
||||
return randomPattern;
|
||||
|
@ -20,11 +20,11 @@
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
|
||||
class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
|
Reference in New Issue
Block a user