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()));
}
}
Aggregations