Search in sources :

Example 6 with StructureGenerator

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

the class GenericVillagePiece method prepare.

public void prepare(WorldServer world) {
    Structure<?> structure = StructureRegistry.INSTANCE.get(structureID);
    if (structure == null)
        return;
    GenerationType generationType = structure.generationType(generationID);
    if (!(generationType instanceof VanillaGeneration))
        return;
    VanillaGeneration vanillaGenInfo = (VanillaGeneration) generationType;
    AxisAlignedTransform2D transform = getTransform(vanillaGenInfo.front, mirrorX, getCoordBaseMode().getOpposite());
    instanceData = new StructureGenerator<>(structure).seed(seed).environment(environment(world, generationType)).transform(transform).boundingBox(boundingBox).instanceData().map(NBTStorable::writeToNBT).orElse(null);
}
Also used : StructureGenerator(ivorius.reccomplex.world.gen.feature.StructureGenerator) AxisAlignedTransform2D(ivorius.ivtoolkit.math.AxisAlignedTransform2D) NBTStorable(ivorius.reccomplex.nbt.NBTStorable) VanillaGeneration(ivorius.reccomplex.world.gen.feature.structure.generic.generation.VanillaGeneration) GenerationType(ivorius.reccomplex.world.gen.feature.structure.generic.generation.GenerationType)

Aggregations

StructureGenerator (ivorius.reccomplex.world.gen.feature.StructureGenerator)6 AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)5 BlockPos (net.minecraft.util.math.BlockPos)5 StructureBoundingBox (net.minecraft.world.gen.structure.StructureBoundingBox)4 SelectionOwner (ivorius.reccomplex.capability.SelectionOwner)3 RCParameters (ivorius.reccomplex.commands.parameters.RCParameters)3 OperationGenerateStructure (ivorius.reccomplex.world.gen.feature.structure.OperationGenerateStructure)3 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)3 WorldServer (net.minecraft.world.WorldServer)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 ImmutableMultimap (com.google.common.collect.ImmutableMultimap)1 Lists (com.google.common.collect.Lists)1 Multimap (com.google.common.collect.Multimap)1 BlockArea (ivorius.ivtoolkit.blocks.BlockArea)1 BlockSurfacePos (ivorius.ivtoolkit.blocks.BlockSurfacePos)1 WeightedSelector (ivorius.ivtoolkit.random.WeightedSelector)1 IvWorldData (ivorius.ivtoolkit.tools.IvWorldData)1 IvFunctions (ivorius.ivtoolkit.util.IvFunctions)1 RCConfig (ivorius.reccomplex.RCConfig)1 RCEntityInfo (ivorius.reccomplex.capability.RCEntityInfo)1