use of com.fastasyncworldedit.core.command.tool.brush.PopulateSchem in project FastAsyncWorldEdit by IntellectualSites.
the class BrushCommands method scatterSchemBrush.
@Command(name = "populateschematic", aliases = { "populateschem", "popschem", "pschem", "ps" }, desc = "Scatter a schematic on a surface")
@CommandPermissions("worldedit.brush.populateschematic")
public void scatterSchemBrush(Player player, InjectedValueAccess context, @Arg(desc = "Mask") Mask mask, @Arg(name = "clipboard", desc = "Clipboard uri") String clipboardStr, @Arg(desc = "Expression", def = "30") Expression radius, @Arg(desc = "double", def = "50") double density, @Switch(name = 'r', desc = "Apply random rotation") boolean rotate) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
try {
MultiClipboardHolder clipboards = ClipboardFormats.loadAllFromInput(player, clipboardStr, null, true);
if (clipboards == null) {
player.print(Caption.of("fawe.error.schematic.not.found", clipboardStr));
return;
}
List<ClipboardHolder> holders = clipboards.getHolders();
if (holders == null) {
player.print(Caption.of("fawe.error.schematic.not.found", clipboardStr));
return;
}
set(context, new PopulateSchem(mask, holders, (int) density, rotate), "worldedit.brush.populateschematic").setSize(radius);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations