Search in sources :

Example 1 with NBTNone

use of ivorius.reccomplex.nbt.NBTNone in project RecurrentComplex by Ivorforce.

the class WorldScriptHolder method generate.

@Override
public void generate(StructureSpawnContext context, RunTransformer transformer, NBTNone instanceData, BlockPos pos) {
    if (worldData == null) {
        return;
    }
    GenericStructure structure = new GenericStructure();
    structure.worldDataCompound = worldData.copy();
    int[] strucSize = structure.size();
    BlockPos strucCoord = context.transform.apply(origin, new int[] { 1, 1, 1 }).subtract(context.transform.apply(BlockPos.ORIGIN, strucSize)).add(pos);
    new StructureGenerator<>(structure).asChild(context).transformer(transformer).lowerCoord(strucCoord).generationPredicate(p -> !p.equals(pos)).generate();
    context.setBlock(pos, replaceState, 2);
}
Also used : RunTransformer(ivorius.reccomplex.world.gen.feature.structure.generic.transformers.RunTransformer) GenericStructure(ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure) Blocks(net.minecraft.init.Blocks) StructureSpawnContext(ivorius.reccomplex.world.gen.feature.structure.context.StructureSpawnContext) TableDataSource(ivorius.reccomplex.gui.table.datasource.TableDataSource) TableDataSourceWorldScriptHolder(ivorius.reccomplex.gui.worldscripts.TableDataSourceWorldScriptHolder) StructureGenerator(ivorius.reccomplex.world.gen.feature.StructureGenerator) NBTNone(ivorius.reccomplex.nbt.NBTNone) Block(net.minecraft.block.Block) Side(net.minecraftforge.fml.relauncher.Side) RecurrentComplex(ivorius.reccomplex.RecurrentComplex) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nullable(javax.annotation.Nullable) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) StructureLoadContext(ivorius.reccomplex.world.gen.feature.structure.context.StructureLoadContext) StructurePrepareContext(ivorius.reccomplex.world.gen.feature.structure.context.StructurePrepareContext) NBTBase(net.minecraft.nbt.NBTBase) BlockPositions(ivorius.ivtoolkit.blocks.BlockPositions) BlockStates(ivorius.ivtoolkit.blocks.BlockStates) BlockPos(net.minecraft.util.math.BlockPos) MCRegistry(ivorius.ivtoolkit.tools.MCRegistry) TableNavigator(ivorius.reccomplex.gui.table.TableNavigator) IBlockState(net.minecraft.block.state.IBlockState) ResourceLocation(net.minecraft.util.ResourceLocation) TableDelegate(ivorius.reccomplex.gui.table.TableDelegate) BlockPos(net.minecraft.util.math.BlockPos) GenericStructure(ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)

Aggregations

BlockPositions (ivorius.ivtoolkit.blocks.BlockPositions)1 BlockStates (ivorius.ivtoolkit.blocks.BlockStates)1 MCRegistry (ivorius.ivtoolkit.tools.MCRegistry)1 RecurrentComplex (ivorius.reccomplex.RecurrentComplex)1 TableDelegate (ivorius.reccomplex.gui.table.TableDelegate)1 TableNavigator (ivorius.reccomplex.gui.table.TableNavigator)1 TableDataSource (ivorius.reccomplex.gui.table.datasource.TableDataSource)1 TableDataSourceWorldScriptHolder (ivorius.reccomplex.gui.worldscripts.TableDataSourceWorldScriptHolder)1 NBTNone (ivorius.reccomplex.nbt.NBTNone)1 StructureGenerator (ivorius.reccomplex.world.gen.feature.StructureGenerator)1 StructureLoadContext (ivorius.reccomplex.world.gen.feature.structure.context.StructureLoadContext)1 StructurePrepareContext (ivorius.reccomplex.world.gen.feature.structure.context.StructurePrepareContext)1 StructureSpawnContext (ivorius.reccomplex.world.gen.feature.structure.context.StructureSpawnContext)1 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)1 RunTransformer (ivorius.reccomplex.world.gen.feature.structure.generic.transformers.RunTransformer)1 Nullable (javax.annotation.Nullable)1 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 Blocks (net.minecraft.init.Blocks)1 NBTBase (net.minecraft.nbt.NBTBase)1