mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Generate every world through built-in module stages and remove the world modes
The overworld pipeline becomes ten built-in modules with typed ordering: biome, terrain, carve, post, floating, deposit, matter, decorant, perfection and custom. The world modes and the dimension's mode setting are gone; a pack's mode key now gets the unknown-key warning. iris:biome, iris:deposit and the cave planning of iris:carve are full ports. Deposits are settings of their own (iris:deposit, written as "deposits": [...]) that stack: a chunk gets the dimension's, the region's and the biome's at its centre column. Cave planning is a mantle stage with a reach of one block, its work done by CaveCarving. The other stages wrap the existing actuators and modifiers. Perfection no longer checks for an overworld.
This commit is contained in:
1 parent
70a69fadad
commit
a77a097baf
34 files changed
+1012
-545
No files matched your search
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.carve.CarveStages;
|
||||
import art.arcane.iris.builtin.terrain.TerrainStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import art.arcane.iris.core.modules.IrisMantleChunk;
|
||||
import art.arcane.iris.engine.mantle.components.CaveCarving;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.volmlib.util.mantle.flag.ReservedFlag;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.MantleStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
/**
|
||||
* Module {@code iris:carve}: caves. A mantle stage plans them into the mantle, reaching one block into each
|
||||
* neighboring chunk where blended cave walls cross the border; a chunk stage later cuts them out of the chunk's
|
||||
* terrain. The mantle stage is a port of what was Iris's carving mantle component, its work done by
|
||||
* {@link CaveCarving}, one per engine runtime. The chunk stage is a thin wrapper around {@link IrisCarveModifier}.
|
||||
*/
|
||||
public final class CarveModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
/** Blended cave walls reach one block past the chunk. */
|
||||
private static final int CAVE_REACH_BLOCKS = 1;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:carve", "Caves", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(CarveStages.CAVES).reach(CAVE_REACH_BLOCKS).run(CarveModule::planCaves);
|
||||
graph.define(CarveStages.APPLY).requires(TerrainStages.SHAPE).run(CarveModule::applyCaves);
|
||||
}
|
||||
|
||||
private static void planCaves(MantleStageContext context) {
|
||||
IrisMantleChunk chunk = IrisMantleChunk.current();
|
||||
if (!carves(chunk.engine().getDimension())) {
|
||||
return;
|
||||
}
|
||||
chunk.state(CaveCarving.class, CaveCarving::new).carve(chunk.writer(), chunk.chunkX(), chunk.chunkZ(), chunk.context());
|
||||
}
|
||||
|
||||
private static void applyCaves(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
if (chunk.bypassesMantleStages()) {
|
||||
return;
|
||||
}
|
||||
chunk.state(IrisCarveModifier.class, IrisCarveModifier::new).modify(chunk.originX() >> CHUNK_SHIFT, chunk.originZ() >> CHUNK_SHIFT,
|
||||
chunk.blocks(), chunk.multicore(), chunk.context());
|
||||
}
|
||||
|
||||
/** A dimension turns carving off with {@code carvingEnabled}, or by listing {@code CARVED} in {@code disabledComponents}. */
|
||||
private static boolean carves(IrisDimension dimension) {
|
||||
return dimension.isCarvingEnabled() && !dimension.getDisabledComponents().contains(ReservedFlag.CARVED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.custom.CustomStages;
|
||||
import art.arcane.iris.builtin.perfection.PerfectionStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
/**
|
||||
* Module {@code iris:custom}: records the chunk's content-plugin blocks for the server to place later. A thin
|
||||
* wrapper: the stage runs {@link IrisCustomModifier} unchanged, one per engine runtime, except while
|
||||
* maintenance regeneration bypasses the mantle.
|
||||
*/
|
||||
public final class CustomModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:custom", "Custom blocks", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(CustomStages.BLOCKS).requires(PerfectionStages.SURFACE).run(CustomModule::record);
|
||||
}
|
||||
|
||||
private static void record(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
if (chunk.bypassesMantleStages()) {
|
||||
return;
|
||||
}
|
||||
chunk.state(IrisCustomModifier.class, IrisCustomModifier::new)
|
||||
.modify(chunk.originX(), chunk.originZ(), chunk.blocks(), chunk.multicore(), chunk.context());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.deposit.DepositSettings;
|
||||
import art.arcane.iris.builtin.deposit.DepositStages;
|
||||
import art.arcane.iris.builtin.floating.FloatingStages;
|
||||
import art.arcane.iris.builtin.terrain.TerrainStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import art.arcane.iris.engine.object.terrain.deposit.IrisDepositGenerator;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Module {@code iris:deposit}: ores and other deposits. The dimension, a region and a biome each declare their
|
||||
* own {@link DepositSettings}, and they stack: a chunk gets every level's deposits at its centre column, the
|
||||
* dimension's first, then the region's, then the biome's. The stage runs where any column of the chunk has
|
||||
* deposits, but places only what the centre column declares, so a chunk's deposits do not depend on which
|
||||
* of its columns a biome border crosses.
|
||||
*/
|
||||
public final class DepositModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
private static final int CHUNK_CENTRE = 7;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:deposit", "Deposits", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(DepositStages.ORES)
|
||||
.when(DepositSettings.class)
|
||||
.requires(TerrainStages.SHAPE)
|
||||
.softAfter(FloatingStages.SOLIDS.ref())
|
||||
.run(DepositModule::place);
|
||||
}
|
||||
|
||||
private static void place(ChunkStageContext context, List<Entry<DepositSettings>> inChunk) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
List<IrisDepositGenerator> generators = generatorsAtCentre(context.settings(), context.originX(), context.originZ());
|
||||
if (generators.isEmpty() || chunk.bypassesMantleStages()) {
|
||||
return;
|
||||
}
|
||||
chunk.state(DepositPlacer.class, DepositPlacer::new).generate(generators, chunk.blocks(),
|
||||
chunk.originX() >> CHUNK_SHIFT, chunk.originZ() >> CHUNK_SHIFT, chunk.multicore(), chunk.context());
|
||||
}
|
||||
|
||||
/** Every level's generators at the centre column of the chunk whose first block is {@code originX}, {@code originZ}, in level order. */
|
||||
static List<IrisDepositGenerator> generatorsAtCentre(FeatureSettings settings, int originX, int originZ) {
|
||||
return settings.at(DepositSettings.class, originX + CHUNK_CENTRE, originZ + CHUNK_CENTRE).stream()
|
||||
.flatMap(entry -> entry.value().generators().stream())
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
+16
-20
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EngineAssignedModifier;
|
||||
import art.arcane.iris.engine.framework.EngineAssignedComponent;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.terrain.deposit.IrisDepositGenerator;
|
||||
import art.arcane.iris.engine.object.terrain.deposit.IrisDepositHeightDistribution;
|
||||
@@ -41,41 +41,37 @@ import art.arcane.volmlib.util.scheduling.PrecisionStopwatch;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
|
||||
public class IrisDepositModifier extends EngineAssignedModifier<PlatformBlockState> {
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Places deposit clumps into one chunk for {@link DepositModule}: one per engine runtime, holding the deposit
|
||||
* stream's random. Each generator gets its own random, derived from the chunk and its position in the list.
|
||||
*/
|
||||
public class DepositPlacer extends EngineAssignedComponent {
|
||||
private final RNG rng;
|
||||
|
||||
public IrisDepositModifier(Engine engine) {
|
||||
public DepositPlacer(Engine engine) {
|
||||
super(engine, "Deposit");
|
||||
rng = new RNG(getEngine().getSeedManager().getDeposit());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onModify(int x, int z, Hunk<PlatformBlockState> output, boolean multicore, ChunkContext context) {
|
||||
/** Runs {@code generators}, in order, on the chunk at chunk coordinates {@code x}, {@code z}. */
|
||||
public void generate(List<IrisDepositGenerator> generators, Hunk<PlatformBlockState> terrain, int x, int z, boolean multicore,
|
||||
ChunkContext context) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
generateDeposits(output, Math.floorDiv(x, 16), Math.floorDiv(z, 16), multicore, context);
|
||||
generateDeposits(generators, terrain, x, z, multicore, context);
|
||||
getEngine().getMetrics().getDeposit().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
public void generateDeposits(Hunk<PlatformBlockState> terrain, int x, int z, boolean multicore, ChunkContext context) {
|
||||
IrisRegion region = context.getRegion().get(7, 7);
|
||||
IrisBiome biome = context.getBiome().get(7, 7);
|
||||
private void generateDeposits(List<IrisDepositGenerator> generators, Hunk<PlatformBlockState> terrain, int x, int z,
|
||||
boolean multicore, ChunkContext context) {
|
||||
BurstExecutor burst = burst().burst(multicore);
|
||||
|
||||
long seed = x * 341873128712L + z * 132897987541L;
|
||||
long mask = 0;
|
||||
MantleChunk chunk = getEngine().getMantle().getMantle().getChunk(x, z).use();
|
||||
try {
|
||||
for (IrisDepositGenerator k : getDimension().getDeposits()) {
|
||||
long finalSeed = seed * ++mask;
|
||||
burst.queue(() -> generate(k, chunk, terrain, rng.nextParallelRNG(finalSeed), x, z, false, context));
|
||||
}
|
||||
|
||||
for (IrisDepositGenerator k : region.getDeposits()) {
|
||||
long finalSeed = seed * ++mask;
|
||||
burst.queue(() -> generate(k, chunk, terrain, rng.nextParallelRNG(finalSeed), x, z, false, context));
|
||||
}
|
||||
|
||||
for (IrisDepositGenerator k : biome.getDeposits()) {
|
||||
for (IrisDepositGenerator k : generators) {
|
||||
long finalSeed = seed * ++mask;
|
||||
burst.queue(() -> generate(k, chunk, terrain, rng.nextParallelRNG(finalSeed), x, z, false, context));
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.decorant.DecorantStages;
|
||||
import art.arcane.iris.builtin.floating.FloatingStages;
|
||||
import art.arcane.iris.builtin.post.PostStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
/**
|
||||
* Module {@code iris:floating}: the islands of floating child biomes, their solids after smoothing and their
|
||||
* decoration after the chunk's own. A thin wrapper: both stages run {@link IrisFloatingChildBiomeModifier}
|
||||
* unchanged, one per engine runtime.
|
||||
*/
|
||||
public final class FloatingModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:floating", "Floating islands", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(FloatingStages.SOLIDS).requires(PostStages.SMOOTH).run(FloatingModule::solids);
|
||||
graph.define(FloatingStages.DECORATE).requires(DecorantStages.DECORATE).run(FloatingModule::decorate);
|
||||
}
|
||||
|
||||
private static void solids(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
islands(chunk).modify(chunk.originX(), chunk.originZ(), chunk.blocks(), chunk.multicore(), chunk.context());
|
||||
}
|
||||
|
||||
private static void decorate(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
islands(chunk).decorateColumns(chunk.originX(), chunk.originZ(), chunk.blocks(), chunk.multicore(), chunk.context());
|
||||
}
|
||||
|
||||
private static IrisFloatingChildBiomeModifier islands(IrisChunk chunk) {
|
||||
return chunk.state(IrisFloatingChildBiomeModifier.class, IrisFloatingChildBiomeModifier::new);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.deposit.DepositStages;
|
||||
import art.arcane.iris.builtin.floating.FloatingStages;
|
||||
import art.arcane.iris.builtin.matter.MatterStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
/**
|
||||
* Module {@code iris:matter}: copies the blocks the mantle planned for the chunk, its objects and structures,
|
||||
* into it. A thin wrapper around the engine mantle's own insertion. It orders itself after deposits without
|
||||
* requiring them, since deposits run only where a level declares some.
|
||||
*/
|
||||
public final class MatterModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:matter", "Mantle blocks", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(MatterStages.INSERT)
|
||||
.requires(FloatingStages.SOLIDS)
|
||||
.softAfter(DepositStages.ORES.ref())
|
||||
.run(MatterModule::insert);
|
||||
}
|
||||
|
||||
private static void insert(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
if (chunk.bypassesMantleStages()) {
|
||||
return;
|
||||
}
|
||||
chunk.engine().getMantle().insertMatter(chunk.originX() >> CHUNK_SHIFT, chunk.originZ() >> CHUNK_SHIFT, chunk.blocks(), chunk.multicore());
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.floating.FloatingStages;
|
||||
import art.arcane.iris.builtin.perfection.PerfectionStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.procedural.IrisProceduralBlocks;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimensionModeType;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -39,7 +39,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Module {@code iris:perfection}: on overworld chunks, turns ores back into the stone around them when the
|
||||
* Module {@code iris:perfection}: turns ores back into the stone around them when the
|
||||
* dimension hides its ores, then removes decorations whose block below cannot hold them, again until none
|
||||
* is left, since removing one can strand the one above.
|
||||
*/
|
||||
@@ -60,16 +60,13 @@ public final class PerfectionModule implements IrisModule {
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(PerfectionStages.SURFACE).run(PerfectionModule::perfect);
|
||||
graph.define(PerfectionStages.SURFACE).requires(FloatingStages.DECORATE).run(PerfectionModule::perfect);
|
||||
}
|
||||
|
||||
private static void perfect(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
Engine engine = chunk.engine();
|
||||
IrisDimension dimension = engine.getDimension();
|
||||
if (dimension.getMode().getType() != IrisDimensionModeType.OVERWORLD) {
|
||||
return;
|
||||
}
|
||||
PrecisionStopwatch stopwatch = PrecisionStopwatch.start();
|
||||
Hunk<PlatformBlockState> blocks = chunk.blocks();
|
||||
if (dimension.isHideOresForHiddenOre()) {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.builtin.carve.CarveStages;
|
||||
import art.arcane.iris.builtin.post.PostStages;
|
||||
import art.arcane.iris.core.modules.IrisChunk;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.StageGraph;
|
||||
|
||||
/**
|
||||
* Module {@code iris:post}: smooths the carved surface. A thin wrapper: the stage runs {@link IrisPostModifier}
|
||||
* unchanged, one per engine runtime, except while maintenance regeneration bypasses the mantle.
|
||||
*/
|
||||
public final class PostModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:post", "Post-processing", VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(StageGraph graph) {
|
||||
graph.define(PostStages.SMOOTH).requires(CarveStages.APPLY).run(PostModule::smooth);
|
||||
}
|
||||
|
||||
private static void smooth(ChunkStageContext context) {
|
||||
IrisChunk chunk = IrisChunk.current();
|
||||
if (chunk.bypassesMantleStages()) {
|
||||
return;
|
||||
}
|
||||
chunk.state(IrisPostModifier.class, IrisPostModifier::new)
|
||||
.modify(chunk.originX(), chunk.originZ(), chunk.blocks(), chunk.multicore(), chunk.context());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user