Search in sources :

Example 1 with LongRangeBuildTool

use of com.sk89q.worldedit.command.tool.LongRangeBuildTool in project FastAsyncWorldEdit by IntellectualSites.

the class ToolCommands method longrangebuildtool.

@Command(name = "lrbuild", aliases = { "/lrbuild" }, desc = "Long-range building tool")
@CommandPermissions("worldedit.tool.lrbuild")
public void longrangebuildtool(Player player, LocalSession session, @Arg(desc = "Pattern to set on left-click") Pattern primary, @Arg(desc = "Pattern to set on right-click") Pattern secondary) throws WorldEditException {
    setTool(player, session, new LongRangeBuildTool(primary, secondary), "worldedit.tool.lrbuild.equip");
    Component primaryName;
    Component secondaryName;
    if (primary instanceof BlockStateHolder) {
        primaryName = ((BlockStateHolder<?>) primary).getBlockType().getRichName();
    } else {
        primaryName = TextComponent.of("pattern");
    }
    if (secondary instanceof BlockStateHolder) {
        secondaryName = ((BlockStateHolder<?>) secondary).getBlockType().getRichName();
    } else {
        secondaryName = TextComponent.of("pattern");
    }
    player.print(Caption.of("worldedit.tool.lrbuild.set", primaryName, secondaryName));
}
Also used : BlockStateHolder(com.sk89q.worldedit.world.block.BlockStateHolder) LongRangeBuildTool(com.sk89q.worldedit.command.tool.LongRangeBuildTool) Component(com.sk89q.worldedit.util.formatting.text.Component) TextComponent(com.sk89q.worldedit.util.formatting.text.TextComponent) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

LongRangeBuildTool (com.sk89q.worldedit.command.tool.LongRangeBuildTool)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 Component (com.sk89q.worldedit.util.formatting.text.Component)1 TextComponent (com.sk89q.worldedit.util.formatting.text.TextComponent)1 BlockStateHolder (com.sk89q.worldedit.world.block.BlockStateHolder)1 Command (org.enginehub.piston.annotation.Command)1