mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 16:54:04 +00:00
Merge branch 'wave3b/5'
# Conflicts: # README.md # builtin-modules.txt
This commit is contained in:
commit
4644d94331
32 files changed
+2080
-1786
No files matched your search
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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.builtin;
|
||||
|
||||
import art.arcane.iris.builtin.decorant.DecorationPart;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* What a cave's floor, ceiling and walls get from the rest of Iris's terrain and decoration: the blocks of a biome's layers
|
||||
* and wall, its decorators and the fluid of the dimension's palette. Those features keep their workers per world and are
|
||||
* ported on their own; until they are modules this narrow interface is the one thing {@code iris:carve} needs from them, in
|
||||
* IrisApi's types, and Iris's worlds implement it ({@link Source}).
|
||||
*
|
||||
* <p>Transitional: when {@code iris:terrain} and {@code iris:decorant} are modules of the same jar, {@code iris:carve} asks
|
||||
* their classes directly and this interface goes.
|
||||
*
|
||||
* <p>The methods that give a block take the {@code chunk} hunk the block is for. A block read from here and written to that
|
||||
* hunk keeps the identity of a content plugin's custom block, as it did when the layers wrote the platform's states themselves.
|
||||
*/
|
||||
public interface CaveDressing {
|
||||
/** The dressing of {@code world}, which must be a world Iris generates. */
|
||||
static CaveDressing of(PackWorld world) {
|
||||
if (world instanceof Source source) {
|
||||
return source.caveDressing();
|
||||
}
|
||||
throw new IllegalArgumentException("Built-in modules generate Iris's own worlds, not " + world);
|
||||
}
|
||||
|
||||
/** Iris's worlds answer for their dressing. */
|
||||
interface Source {
|
||||
CaveDressing caveDressing();
|
||||
}
|
||||
|
||||
/** Whether the dimension's fluid palette gives a fluid (water, lava) at the column; false where it gives none. */
|
||||
boolean fluidPresentAt(int x, int z);
|
||||
|
||||
/** The block the dimension's fluid palette gives at the column; null where it gives none. */
|
||||
BlockState fluidAt(Hunk<BlockState> chunk, int x, int z);
|
||||
|
||||
/** The block the biome's wall gives at the position; null where the biome has no wall or the layer gives none. */
|
||||
BlockState wall(Hunk<BlockState> chunk, ResourceId biome, RNG rng, int x, int y, int z);
|
||||
|
||||
/** The blocks the biome's surface layers stack up to at the column, top first, at most {@code depth} of them. */
|
||||
List<BlockState> floorLayers(Hunk<BlockState> chunk, ResourceId biome, int x, int z, RNG rng, int depth, int floorY);
|
||||
|
||||
/** The blocks the biome's cave ceiling layers stack up to at the column, nearest the ceiling first, at most {@code depth} of them. */
|
||||
List<BlockState> ceilingLayers(Hunk<BlockState> chunk, ResourceId biome, int x, int z, RNG rng, int depth, int ceilingY);
|
||||
|
||||
/** Whether the biome has a decorator for {@code part}. */
|
||||
boolean hasDecorators(ResourceId biome, DecorationPart part);
|
||||
|
||||
/**
|
||||
* Decorates a cave's floor in the column at {@code chunk}'s {@code localX}, {@code localZ} (world {@code x}, {@code z}) above
|
||||
* the block at {@code floorY}, with the biome's decorators for {@link DecorationPart#NONE}, in a space {@code airThickness} high.
|
||||
*/
|
||||
void decorateFloor(Hunk<BlockState> chunk, int localX, int localZ, int x, int z, ResourceId biome, int floorY, int airThickness);
|
||||
|
||||
/** Decorates a cave's ceiling the same way, from the block at {@code ceilingY} down, with the decorators for {@link DecorationPart#CEILING}. */
|
||||
void decorateCeiling(Hunk<BlockState> chunk, int localX, int localZ, int x, int z, ResourceId biome, int ceilingY, int airThickness);
|
||||
|
||||
/**
|
||||
* {@code layer}, the block a layer wants in the place of the ore {@code existing}, as the deepslate or the stone variant
|
||||
* of the ore that fits the rock {@code existing} is; {@code layer} itself where it has no variant.
|
||||
*/
|
||||
BlockState deepSlateOre(Hunk<BlockState> chunk, BlockState existing, BlockState layer);
|
||||
}
|
||||
@@ -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.builtin;
|
||||
|
||||
import art.arcane.volmlib.util.mantle.runtime.MantleChunk;
|
||||
import art.arcane.volmlib.util.matter.Matter;
|
||||
import com.volmit.host.ReadOnlyMantle;
|
||||
import com.volmit.mantle.Mantle;
|
||||
|
||||
/**
|
||||
* Iris's mantle as the matter slices it stores, for the built-ins whose data the platform and the rest of Iris read as
|
||||
* slices rather than through a {@link com.volmit.mantle.MantleLayer}: caves ({@code MatterCavern}) and markers. The
|
||||
* slices are VolmLib's own types, which a pack module may use as well; Iris's worlds implement this next to
|
||||
* {@link Mantle}, and {@link #of(Mantle)} reaches it from an invocation's mantle.
|
||||
*
|
||||
* <p>Heights are as the mantle stores them: above the dimension's bottom. A chunk the invocation reaches is pinned for
|
||||
* as long as the invocation runs; callers neither release it nor keep it afterwards.
|
||||
*/
|
||||
public interface MatterMantle {
|
||||
/**
|
||||
* The matter side of {@code mantle}, which must be a mantle Iris hands to its stages. A chunk stage's mantle is read-only
|
||||
* to the stage; the matter behind it is not, and a built-in chunk stage that writes markers into it (the caves' floors and
|
||||
* ceilings) is why this reaches through.
|
||||
*/
|
||||
static MatterMantle of(Mantle mantle) {
|
||||
if (mantle instanceof ReadOnlyMantle readOnly) {
|
||||
return of(readOnly.host());
|
||||
}
|
||||
if (mantle instanceof MatterMantle matter) {
|
||||
return matter;
|
||||
}
|
||||
throw new IllegalArgumentException("Built-in modules write Iris's own mantle, not " + mantle);
|
||||
}
|
||||
|
||||
/** The mantle chunk at chunk coordinates {@code chunkX}, {@code chunkZ}, or null outside what the invocation reaches. */
|
||||
MantleChunk<Matter> chunk(int chunkX, int chunkZ);
|
||||
|
||||
/**
|
||||
* The mantle chunk at those coordinates if the world holds it in memory, wherever it is, or null. It is never loaded
|
||||
* or created for the call and not pinned, so read it at once and do not keep it.
|
||||
*/
|
||||
MantleChunk<Matter> loadedChunk(int chunkX, int chunkZ);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
|
||||
/** A dimension's {@code caveLavaHeight}, written as the bare number. */
|
||||
@Desc("The subterranean fluid (cave lava) layer height, in engine-local Y where 0 is the bottom of the dimension, not world Y. With the default -64..320 height, 8 means world Y -56.")
|
||||
@Feature(id = "iris:carve/lava-height", name = "Cave lava height", key = "caveLavaHeight", root = "height", targets = Target.DIMENSION)
|
||||
public final class CaveLavaHeightSettings implements IrisFeature {
|
||||
public static final int DEFAULT_HEIGHT = 8;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(318)
|
||||
@Desc("The subterranean fluid (cave lava) layer height, in engine-local Y where 0 is the bottom of the dimension, not world Y. With the default -64..320 height, 8 means world Y -56.")
|
||||
private int height = DEFAULT_HEIGHT;
|
||||
|
||||
public CaveLavaHeightSettings() {
|
||||
}
|
||||
|
||||
public CaveLavaHeightSettings(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int height() {
|
||||
return height;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** A dimension's {@code upperDimensionCarving}, written as the bare boolean. */
|
||||
@Desc("When true, cave carving will cut through the upper dimension terrain. When false, the upper terrain is a solid untouched mass.")
|
||||
@Feature(id = "iris:carve/upper-dimension", name = "Upper dimension carving", key = "upperDimensionCarving", root = "enabled", targets = Target.DIMENSION)
|
||||
public final class UpperDimensionCarvingSettings implements IrisFeature {
|
||||
@Desc("When true, cave carving will cut through the upper dimension terrain. When false, the upper terrain is a solid untouched mass.")
|
||||
private boolean enabled = false;
|
||||
|
||||
public UpperDimensionCarvingSettings() {
|
||||
}
|
||||
|
||||
public UpperDimensionCarvingSettings(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user