Search in sources :

Example 1 with OperationGenerateSchematic

use of ivorius.reccomplex.operation.OperationGenerateSchematic in project RecurrentComplex by Ivorforce.

the class CommandImportSchematic method execute.

@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
    Function<Parameters, Parameters> c = expect()::declare;
    Parameters parameters = Parameters.of(args, c);
    if (args.length < 1)
        throw RecurrentComplex.translations.wrongUsageException("commands.rcimportschematic.usage");
    SchematicFile schematicFile = parseSchematic(parameters.get(0).require());
    BlockPos pos = parameters.get(MCP.pos("x", "y", "z", commandSender.getPosition(), false)).require();
    AxisAlignedTransform2D transform = parameters.get(IvP.transform("rotation", "mirror")).optional().orElse(AxisAlignedTransform2D.ORIGINAL);
    OperationRegistry.queueOperation(new OperationGenerateSchematic(schematicFile, transform, pos), commandSender);
}
Also used : SchematicFile(ivorius.reccomplex.world.gen.feature.structure.schematics.SchematicFile) Parameters(ivorius.mcopts.commands.parameters.Parameters) AxisAlignedTransform2D(ivorius.ivtoolkit.math.AxisAlignedTransform2D) OperationGenerateSchematic(ivorius.reccomplex.operation.OperationGenerateSchematic) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)1 Parameters (ivorius.mcopts.commands.parameters.Parameters)1 OperationGenerateSchematic (ivorius.reccomplex.operation.OperationGenerateSchematic)1 SchematicFile (ivorius.reccomplex.world.gen.feature.structure.schematics.SchematicFile)1 BlockPos (net.minecraft.util.math.BlockPos)1