Search in sources :

Example 11 with NoMatchException

use of com.sk89q.worldedit.extension.input.NoMatchException in project FastAsyncWorldEdit by IntellectualSites.

the class ConsumeBindings method baseBlock.

@Binding
public BaseBlock baseBlock(Actor actor, String argument) {
    ParserContext parserContext = new ParserContext();
    parserContext.setActor(actor);
    if (actor instanceof Entity) {
        Extent extent = ((Entity) actor).getExtent();
        if (extent instanceof World) {
            parserContext.setWorld((World) extent);
        }
    }
    parserContext.setSession(getWorldEdit().getSessionManager().get(actor));
    try {
        return getWorldEdit().getBlockFactory().parseFromInput(argument, parserContext);
    } catch (NoMatchException e) {
        throw new InputParseException(TextComponent.of(e.getMessage()));
    }
}
Also used : Entity(com.sk89q.worldedit.entity.Entity) InputParseException(com.sk89q.worldedit.extension.input.InputParseException) Extent(com.sk89q.worldedit.extent.Extent) ParserContext(com.sk89q.worldedit.extension.input.ParserContext) World(com.sk89q.worldedit.world.World) NoMatchException(com.sk89q.worldedit.extension.input.NoMatchException)

Aggregations

NoMatchException (com.sk89q.worldedit.extension.input.NoMatchException)11 InputParseException (com.sk89q.worldedit.extension.input.InputParseException)6 Actor (com.sk89q.worldedit.extension.platform.Actor)4 Map (java.util.Map)4 BaseItem (com.sk89q.worldedit.blocks.BaseItem)3 ParserContext (com.sk89q.worldedit.extension.input.ParserContext)3 World (com.sk89q.worldedit.world.World)3 SuggestInputParseException (com.fastasyncworldedit.core.command.SuggestInputParseException)2 Caption (com.fastasyncworldedit.core.configuration.Caption)2 ResettableExtent (com.fastasyncworldedit.core.extent.ResettableExtent)2 SlottableBlockBag (com.fastasyncworldedit.core.extent.inventory.SlottableBlockBag)2 NBTException (com.fastasyncworldedit.core.jnbt.NBTException)2 FaweLimit (com.fastasyncworldedit.core.limit.FaweLimit)2 TrueRandom (com.fastasyncworldedit.core.math.random.TrueRandom)2 StringMan (com.fastasyncworldedit.core.util.StringMan)2 BlanketBaseBlock (com.fastasyncworldedit.core.world.block.BlanketBaseBlock)2 CompoundTag (com.sk89q.jnbt.CompoundTag)2 CommandLocals (com.sk89q.minecraft.util.commands.CommandLocals)2 IncompleteRegionException (com.sk89q.worldedit.IncompleteRegionException)2 WorldEdit (com.sk89q.worldedit.WorldEdit)2