Search in sources :

Example 1 with OperationGenerateStructure

use of ivorius.reccomplex.world.gen.feature.structure.OperationGenerateStructure in project RecurrentComplex by Ivorforce.

the class CommandSelectDuplicate method execute.

@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
    RCParameters parameters = RCParameters.of(args, "mirror");
    SelectionOwner selectionOwner = RCCommands.getSelectionOwner(commandSender, null, true);
    BlockArea area = selectionOwner.getSelection();
    BlockPos pos = parameters.pos("x", "y", "z", commandSender.getPosition(), false).require();
    AxisAlignedTransform2D transform = parameters.transform("rotation", "mirror").optional().orElse(AxisAlignedTransform2D.ORIGINAL);
    IvWorldData worldData = IvWorldData.capture(commandSender.getEntityWorld(), area, true);
    NBTTagCompound worldDataCompound = worldData.createTagCompound();
    GenericStructure structureInfo = GenericStructure.createDefaultStructure();
    structureInfo.worldDataCompound = worldDataCompound;
    OperationRegistry.queueOperation(new OperationGenerateStructure(structureInfo, null, transform, pos, true).prepare((WorldServer) commandSender.getEntityWorld()), commandSender);
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) BlockArea(ivorius.ivtoolkit.blocks.BlockArea) OperationGenerateStructure(ivorius.reccomplex.world.gen.feature.structure.OperationGenerateStructure) SelectionOwner(ivorius.reccomplex.capability.SelectionOwner) AxisAlignedTransform2D(ivorius.ivtoolkit.math.AxisAlignedTransform2D) IvWorldData(ivorius.ivtoolkit.tools.IvWorldData) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) BlockPos(net.minecraft.util.math.BlockPos) WorldServer(net.minecraft.world.WorldServer) GenericStructure(ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)

Aggregations

BlockArea (ivorius.ivtoolkit.blocks.BlockArea)1 AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)1 IvWorldData (ivorius.ivtoolkit.tools.IvWorldData)1 SelectionOwner (ivorius.reccomplex.capability.SelectionOwner)1 RCParameters (ivorius.reccomplex.commands.parameters.RCParameters)1 OperationGenerateStructure (ivorius.reccomplex.world.gen.feature.structure.OperationGenerateStructure)1 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 BlockPos (net.minecraft.util.math.BlockPos)1 WorldServer (net.minecraft.world.WorldServer)1