mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Ores, hideOresForHiddenOre, deposit variants and the ore deposit multipliers are settings of iris:terrain and iris:deposit
OreSettings (ores), HideOresSettings (hideOresForHiddenOre), DepositVariantSettings (depositVariants), OreFrequencySettings and OreSizeSettings are IrisApi-typed features under the keys packs always wrote. ResolvedOre/ResolvedOres/TerrainOres keep the resolved blocks and the chance noise per world, warmed in the same order and with the same seeds as before; ResolvedDepositVariant resolves the remaps. IrisBiome, IrisRegion and IrisDimension lose the fields and their caches; IrisOreGenerator, IrisBiomeOres, IrisOreGeneratorBounds and IrisDepositVariant are deleted. Inferred biome variants keep the module settings of the biome they are copied from.
This commit is contained in:
1 parent
dcf5cc045a
commit
6617cc3957
24 files changed
+884
-691
No files matched your search
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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.deposit;
|
||||
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Required;
|
||||
import com.volmit.config.Snippet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* One deposit ore remap rule, an entry of {@code depositVariants}: within a vertical band, ore blocks are rewritten to
|
||||
* alternate blocks. A value of IrisApi types only; {@code ResolvedDepositVariant} resolves the blocks.
|
||||
*/
|
||||
@Snippet("deposit-variant")
|
||||
@Desc("Remaps ore block ids to alternate block ids within a vertical band. Ores declared at dimension, region, and biome scope can be rewritten at placement time (for example, iron_ore -> deepslate_iron_ore inside a deep carving band, or yourmod:iron -> yourmod:moon_iron inside a lunar biome).")
|
||||
public final class DepositVariant {
|
||||
@Required
|
||||
@MinNumber(-2048)
|
||||
@MaxNumber(8192)
|
||||
@Desc("Inclusive minimum world Y this variant applies at.")
|
||||
private int minHeight = 0;
|
||||
|
||||
@Required
|
||||
@MinNumber(-2048)
|
||||
@MaxNumber(8192)
|
||||
@Desc("Inclusive maximum world Y this variant applies at.")
|
||||
private int maxHeight = 0;
|
||||
|
||||
@Required
|
||||
@Desc("Source block id (for example `minecraft:iron_ore`) -> replacement block id (for example `minecraft:deepslate_iron_ore`). Any block id the data loader resolves is accepted, including external/mod blocks. Source match is by material only, so block properties on the source key are ignored.")
|
||||
private Map<String, String> remap = Map.of();
|
||||
|
||||
public DepositVariant() {
|
||||
}
|
||||
|
||||
public int minHeight() {
|
||||
return minHeight;
|
||||
}
|
||||
|
||||
public int maxHeight() {
|
||||
return maxHeight;
|
||||
}
|
||||
|
||||
public Map<String, String> remap() {
|
||||
return remap == null ? Map.of() : Collections.unmodifiableMap(remap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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.deposit;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
import com.volmit.config.MinItems;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The deposit ore remap rules one dimension, region or biome declares, written as {@code "depositVariants": [...]}, the list
|
||||
* of {@link DepositVariant}s. The biome's rules apply first, then the region's, then the dimension's; the first matching rule wins.
|
||||
*/
|
||||
@Desc("Deposit ore remap rules. Each entry declares a vertical band and a source->replacement block id map. Applied biome first, then region, then dimension; first matching rule wins.")
|
||||
@Feature(id = "iris:deposit/variants", name = "Deposit variants", key = "depositVariants", root = "variants",
|
||||
targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
public final class DepositVariantSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Deposit ore remap rules. Each entry declares a vertical band and a source->replacement block id map. Applied biome first, then region, then dimension; first matching rule wins.")
|
||||
private List<DepositVariant> variants = List.of();
|
||||
|
||||
public DepositVariantSettings() {
|
||||
}
|
||||
|
||||
public DepositVariantSettings(List<DepositVariant> variants) {
|
||||
this.variants = List.copyOf(variants);
|
||||
}
|
||||
|
||||
public List<DepositVariant> variants() {
|
||||
return variants == null ? List.of() : Collections.unmodifiableList(variants);
|
||||
}
|
||||
}
|
||||
@@ -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.deposit;
|
||||
|
||||
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 biome's {@code oreDepositFrequencyMultiplier}, written as the bare number. */
|
||||
@Desc("Multiplier applied to the frequency of every ore deposit whose center is inside this biome. A value of 0.4 keeps 40% of ore veins while leaving non-ore deposits unchanged.")
|
||||
@Feature(id = "iris:deposit/ore-frequency", name = "Ore deposit frequency", key = "oreDepositFrequencyMultiplier", root = "multiplier", targets = Target.BIOME)
|
||||
public final class OreFrequencySettings implements IrisFeature {
|
||||
private static final double UNCHANGED = 1D;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Multiplier applied to the frequency of every ore deposit whose center is inside this biome. A value of 0.4 keeps 40% of ore veins while leaving non-ore deposits unchanged.")
|
||||
private double multiplier = UNCHANGED;
|
||||
|
||||
public OreFrequencySettings() {
|
||||
}
|
||||
|
||||
public OreFrequencySettings(double multiplier) {
|
||||
this.multiplier = multiplier;
|
||||
}
|
||||
|
||||
public double multiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
}
|
||||
@@ -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.deposit;
|
||||
|
||||
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 biome's {@code oreDepositSizeMultiplier}, written as the bare number. */
|
||||
@Desc("Multiplier applied to the block count of every ore deposit whose center is inside this biome. Non-ore deposits are unchanged.")
|
||||
@Feature(id = "iris:deposit/ore-size", name = "Ore deposit size", key = "oreDepositSizeMultiplier", root = "multiplier", targets = Target.BIOME)
|
||||
public final class OreSizeSettings implements IrisFeature {
|
||||
private static final double UNCHANGED = 1D;
|
||||
|
||||
@MinNumber(0.01)
|
||||
@MaxNumber(16)
|
||||
@Desc("Multiplier applied to the block count of every ore deposit whose center is inside this biome. Non-ore deposits are unchanged.")
|
||||
private double multiplier = UNCHANGED;
|
||||
|
||||
public OreSizeSettings() {
|
||||
}
|
||||
|
||||
public OreSizeSettings(double multiplier) {
|
||||
this.multiplier = multiplier;
|
||||
}
|
||||
|
||||
public double multiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/**
|
||||
* A dimension's {@code hideOresForHiddenOre}: whether every ore block the generator would place is replaced with its base
|
||||
* material. Written as the bare boolean.
|
||||
*/
|
||||
@Desc("When true, every ore block the generator would place (terrain ores, deposits, ores inside objects) is replaced with its base material such as stone, deepslate or netherrack, so drop-control plugins like HiddenOre can manage ore rewards themselves")
|
||||
@Feature(id = "iris:terrain/hide-ores", name = "Hide ores", key = "hideOresForHiddenOre", root = "hide", targets = Target.DIMENSION)
|
||||
public final class HideOresSettings implements IrisFeature {
|
||||
@Desc("When true, every ore block the generator would place (terrain ores, deposits, ores inside objects) is replaced with its base material such as stone, deepslate or netherrack, so drop-control plugins like HiddenOre can manage ore rewards themselves")
|
||||
private boolean hide = false;
|
||||
|
||||
public HideOresSettings() {
|
||||
}
|
||||
|
||||
public HideOresSettings(boolean hide) {
|
||||
this.hide = hide;
|
||||
}
|
||||
|
||||
public boolean hide() {
|
||||
return hide;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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.terrain;
|
||||
|
||||
import com.volmit.block.PaletteSpec;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Range;
|
||||
import com.volmit.noise.NoiseStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* One ore generator of a dimension, region or biome, an entry of its {@code ores} list: single ore blocks scattered
|
||||
* through the terrain by a noise field, in a vertical band. A value of IrisApi types only; the terrain module resolves
|
||||
* its blocks and builds its noise ({@code ResolvedOre}).
|
||||
*/
|
||||
@Desc("Scatters single ore blocks through terrain by sampling a noise field at every block in a vertical band. Defined on dimensions, regions, or biomes; the most specific level wins.")
|
||||
public final class OreGenerator {
|
||||
private static final double DEFAULT_THRESHOLD = 0.5;
|
||||
private static final double DEFAULT_RANGE_MIN = 30;
|
||||
private static final double DEFAULT_RANGE_MAX = 80;
|
||||
|
||||
@Desc("The ore blocks to place. An empty palette generates nothing, so this must be set for the generator to have any effect.")
|
||||
private PaletteSpec palette = PaletteSpec.of(List.of());
|
||||
|
||||
@Desc("The noise style sampled per block to decide where ore appears. STATIC gives independent random speckle; smoother styles give veiny clusters.")
|
||||
private NoiseStyle chanceStyle = NoiseStyle.of("STATIC");
|
||||
|
||||
@Desc("When true this generator also replaces surface-layer blocks (it runs before layers and fluid); when false it only replaces underground rock.")
|
||||
private boolean generateSurface = false;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Noise cutoff: a block becomes ore when the sampled noise is at or below this value, so higher means more ore. 0 disables, 1 replaces everything in range.")
|
||||
private double threshold = DEFAULT_THRESHOLD;
|
||||
|
||||
@Desc("Vertical band (min, max) this ore can generate in, in engine-local Y where 0 is the bottom of the dimension, not world Y.")
|
||||
private Range range = Range.of(DEFAULT_RANGE_MIN, DEFAULT_RANGE_MAX);
|
||||
|
||||
public OreGenerator() {
|
||||
}
|
||||
|
||||
public PaletteSpec palette() {
|
||||
return palette;
|
||||
}
|
||||
|
||||
public NoiseStyle chanceStyle() {
|
||||
return chanceStyle;
|
||||
}
|
||||
|
||||
public boolean generateSurface() {
|
||||
return generateSurface;
|
||||
}
|
||||
|
||||
public double threshold() {
|
||||
return threshold;
|
||||
}
|
||||
|
||||
public Range range() {
|
||||
return range;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
import com.volmit.config.MinItems;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The ore generators one dimension, region or biome declares, written as {@code "ores": [...]}, the list of generators.
|
||||
* Levels stack: a column's ores come from its biome first, then its region, then the dimension. IrisApi types only,
|
||||
* like {@link OreGenerator}.
|
||||
*/
|
||||
@Desc("Collection of ores to be generated")
|
||||
@Feature(id = "iris:terrain/ores", name = "Ores", key = "ores", root = "generators", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
public final class OreSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Collection of ores to be generated")
|
||||
private List<OreGenerator> generators = List.of();
|
||||
|
||||
public OreSettings() {
|
||||
}
|
||||
|
||||
public OreSettings(List<OreGenerator> generators) {
|
||||
this.generators = List.copyOf(generators);
|
||||
}
|
||||
|
||||
public List<OreGenerator> generators() {
|
||||
return generators == null ? List.of() : Collections.unmodifiableList(generators);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user