mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-07 00:06:12 +00:00
meta-ify BiomePipelineTemplate
This commit is contained in:
@@ -3,6 +3,7 @@ package com.dfsek.terra.config.loaders.config.biome.templates.provider;
|
||||
import com.dfsek.tectonic.annotations.Default;
|
||||
import com.dfsek.tectonic.annotations.Value;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.config.meta.MetaValue;
|
||||
import com.dfsek.terra.api.util.seeded.SourceSeeded;
|
||||
import com.dfsek.terra.api.util.seeded.StageSeeded;
|
||||
import com.dfsek.terra.api.world.biome.pipeline.BiomePipeline;
|
||||
@@ -16,13 +17,13 @@ public class BiomePipelineTemplate extends BiomeProviderTemplate {
|
||||
private final TerraPlugin main;
|
||||
@Value("pipeline.initial-size")
|
||||
@Default
|
||||
private int initialSize = 2;
|
||||
private MetaValue<Integer> initialSize = MetaValue.of(2);
|
||||
|
||||
@Value("pipeline.stages")
|
||||
private List<StageSeeded> stages;
|
||||
private List<MetaValue<StageSeeded>> stages;
|
||||
|
||||
@Value("pipeline.source")
|
||||
private SourceSeeded source;
|
||||
private MetaValue<SourceSeeded> source;
|
||||
|
||||
public BiomePipelineTemplate(TerraPlugin main) {
|
||||
this.main = main;
|
||||
@@ -30,9 +31,9 @@ public class BiomePipelineTemplate extends BiomeProviderTemplate {
|
||||
|
||||
@Override
|
||||
public BiomeProvider build(long seed) {
|
||||
BiomePipeline.BiomePipelineBuilder biomePipelineBuilder = new BiomePipeline.BiomePipelineBuilder(initialSize);
|
||||
stages.forEach(biomePipelineBuilder::addStage);
|
||||
BiomePipeline pipeline = biomePipelineBuilder.build(source.apply(seed), seed);
|
||||
BiomePipeline.BiomePipelineBuilder biomePipelineBuilder = new BiomePipeline.BiomePipelineBuilder(initialSize.get());
|
||||
stages.stream().map(MetaValue::get).forEach(biomePipelineBuilder::addStage);
|
||||
BiomePipeline pipeline = biomePipelineBuilder.build(source.get().apply(seed), seed);
|
||||
return new StandardBiomeProvider(pipeline, main, resolution, blend.apply(seed), blendAmp, (int) seed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user