use of ivorius.reccomplex.world.gen.feature.structure.generic.transformers.TransformerMulti in project RecurrentComplex by Ivorforce.
the class RCConfig method getUniversalTransformer.
public static TransformerMulti getUniversalTransformer() {
if (universalTransformer == null) {
universalTransformer = new TransformerMulti("rc_universal", "");
universalTransformer.getData().setToCustom();
universalTransformer.getTransformers().clear();
universalTransformerPresets.stream().map(TransformerMulti::fromPreset).forEach(universalTransformer.getTransformers()::add);
}
return universalTransformer;
}
use of ivorius.reccomplex.world.gen.feature.structure.generic.transformers.TransformerMulti in project RecurrentComplex by Ivorforce.
the class GenericStructure method prepareInstanceData.
@Nullable
@Override
public InstanceData prepareInstanceData(@Nonnull StructurePrepareContext context, @Nonnull TransformerMulti foreignTransformer) {
InstanceData instanceData = new InstanceData();
if (!context.generateAsSource) {
IvWorldData worldData = constructWorldData();
IvBlockCollection blockCollection = worldData.blockCollection;
int[] areaSize = new int[] { blockCollection.width, blockCollection.height, blockCollection.length };
BlockPos origin = StructureBoundingBoxes.min(context.boundingBox);
variableDomain.fill(instanceData.variableDomain, context.environment, context.random);
instanceData.variableDomain.fill(context.environment.variables);
instanceData.transformerData = this.transformer.prepareInstanceData(context, worldData);
instanceData.foreignTransformerData = foreignTransformer.prepareInstanceData(context, worldData);
TransformerMulti transformer = TransformerMulti.fuse(Arrays.asList(this.transformer, foreignTransformer));
TransformerMulti.InstanceData cInstanceData = transformer.fuseDatas(Arrays.asList(instanceData.transformerData, instanceData.foreignTransformerData));
RunTransformer runTransformer = new RunTransformer(transformer, cInstanceData);
transformer.configureInstanceData(cInstanceData, context, worldData, runTransformer);
if (context.generateMaturity.isSuggest() && !transformer.mayGenerate(cInstanceData, context, worldData, runTransformer))
return null;
worldData.tileEntities.forEach(tileEntityCompound -> {
asGeneratingTileEntity(context, IvTileEntityHelper.getAnyWorld(), areaSize, origin, tileEntityCompound, (src, tileEntity) -> {
NBTStorable tileEntityInstanceData = (NBTStorable) tileEntity.prepareInstanceData(context);
if (tileEntityInstanceData != null)
instanceData.tileEntities.put(src, tileEntityInstanceData);
});
});
}
return instanceData;
}
Aggregations