mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Run each mantle stage as its own pass and let mantle stages work out their reach per pack
MantleRunner.generate(stage, inputs, seed) runs one mantle stage for one chunk. The host runs every mantle stage as its own pass in resolved order, so a stage sees what earlier stages wrote into the chunks around it. Activation still follows requires(...): the runner collects the settings of the stage and of everything it requires, and only those. Because the stages of one chunk now run in different invocations, mantle stages have no output (Stage.mantle declares Void) and pass data on through mantle layers. A mantle stage whose reach depends on the pack declares reach(PackReach). The host works it out once per pack load from PackSettings, every entry the dimension and its regions and biomes declare, with ResolvedStage.reachBlocks(settings); a negative result fails naming the stage. Placement and chunk stages may not declare one, and ResolvedGraph.reach() throws for a mantle pipeline that has one. VeinModule now sizes its reach from the pack's longest vein.
This commit is contained in:
1 parent
97ac2a2982
commit
50f51db8b2
25 files changed
+410
-89
No files matched your search
@@ -8,10 +8,11 @@ import com.volmit.resource.ResourceId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/** The settings one chunk's stages see: for every settings type the graph conditions on, each distinct
|
||||
* entry of the chunk's 16 by 16 columns. A stage is therefore active when any column of the chunk
|
||||
/** The settings one chunk's stages see: for every settings type the running stages condition on, each
|
||||
* distinct entry of the chunk's 16 by 16 columns. A stage is therefore active when any column of the chunk
|
||||
* configures its settings, also where a biome border crosses the chunk. Entries are distinct by level
|
||||
* and source and keep the order their first column was read in, columns by X and then Z.
|
||||
*/
|
||||
@@ -21,14 +22,14 @@ final class ChunkSettings {
|
||||
|
||||
private ChunkSettings() {}
|
||||
|
||||
/** {@code settings} is asked only when the graph conditions a stage on settings. */
|
||||
static ConfiguredSettings collect(ResolvedGraph graph, Supplier<FeatureSettings> settings, int originX, int originZ) {
|
||||
if (graph.settingsTypes().isEmpty()) {
|
||||
/** {@code settings} is asked only when {@code types} is not empty. */
|
||||
static ConfiguredSettings collect(List<Class<?>> types, Supplier<FeatureSettings> settings, int originX, int originZ) {
|
||||
if (types.isEmpty()) {
|
||||
return ConfiguredSettings.none();
|
||||
}
|
||||
var view = settings.get();
|
||||
var entries = new ArrayList<Entry<?>>();
|
||||
for (var type : graph.settingsTypes()) {
|
||||
for (var type : types) {
|
||||
entries.addAll(distinctEntries(type.asSubclass(IrisFeature.class), view, originX, originZ));
|
||||
}
|
||||
return ConfiguredSettings.of(entries);
|
||||
|
||||
Reference in new issue
Block a user