Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/OreSpawn-4.1.4.110021.jar
build/libs/OreSpawn-4.1.4.110021-sources.jar
build/libs/OreSpawn-4.1.4.110021-javadoc.jar
build/libs/OreSpawn-4.1.5.110021.jar
build/libs/OreSpawn-4.1.5.110021-sources.jar
build/libs/OreSpawn-4.1.5.110021-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 4.1.5.110021

* Apply the normal gold-generation controls to Mesa's extra gold pass too.
Keep custom channels, imported settings and existing chunks unchanged.

Version 4.1.4.110021

* Let Java providers select an exact legacy host variant, such as plain stone
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It gives mods and modpacks one place to configure ores, deposit shapes, optional
rock strata and geomes, provider-owned underground fluid deposits, biome
palettes and world materials, flat bedrock, and bounded ore retrogen.

This branch builds target-qualified version `4.1.4.110021`: the OreSpawn 4.1.4
This branch builds target-qualified version `4.1.5.110021`: the OreSpawn 4.1.5
feature set for Minecraft 1.10.2 and Forge. It adds stable generation identity,
non-loading geology sampling, per-resource background control, existing-world
provider merge policy, an Ore Sources arbiter for equivalent provider ores and
Expand Down
7 changes: 7 additions & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ Settings refuses to move a native vanilla ore's Ore Dictionary alias into
another material group and explains that vanilla management must be enabled
first.

On Minecraft 1.10.2, Mesa's extra gold follows the same decision as ordinary
gold. With vanilla management off, imported vanilla rules stay saved but
inactive. A child's hybrid or replacement policy can still limit native gold,
including Mesa gold. With management on, the selected ordinary rule supplies
gold without a second native Mesa pass. Explicit custom channels remain
independent, and none of these controls rewrites already generated chunks.

Consolidation runs the chosen placement rule's pattern, hosts, filters, height
and frequency once; selected candidates contribute output bundles only. An
inactive managed provider may therefore supply an output block without adding
Expand Down
2 changes: 1 addition & 1 deletion docs/VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Examples:

| Minecraft | Loader | Target | Example full version |
| --- | --- | ---: | --- |
| 1.10.2 | Forge | `110021` | `4.1.4.110021` |
| 1.10.2 | Forge | `110021` | `4.1.5.110021` |
| 1.12.2 | Forge | `112021` | `4.0.6.112021` |
| 1.13.2 | Forge | `113021` | `4.0.6.113021` |
| 1.20.6 | Forge | `120061` | `4.0.6.120061` |
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod_vendor=Minecraft Mod Development
mod_license=LGPL-2.1
mod_license_name=GNU Lesser General Public License, Version 2.1
mod_license_url=https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
mod_version=4.1.4.110021
mod_version=4.1.5.110021
mod_group=zone.moddev.mc.orespawn
mod_authors=SkyBlade1978, dshadowwolf, the MMD Team
mod_description=Configurable, provider-driven terrain, ore, and deposit generation.
Expand Down
6 changes: 3 additions & 3 deletions gradle/release/artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tasks.register('verifyReleaseConfiguration') {
description = 'Validates the target-qualified release, API, schemas, reports, and publishing identity.'

doLast {
if (project.mod_version != '4.1.4.110021'
if (project.mod_version != '4.1.5.110021'
|| project.mod_group != expectedMavenGroup) {
throw new GradleException("Unexpected OreSpawn release version: ${project.mod_version}")
}
Expand Down Expand Up @@ -106,8 +106,8 @@ tasks.register('verifyReleaseConfiguration') {
'src/main/java/zone/moddev/mc/orespawn/worldgen/LegacyOs3ProfileMigration.java',
'README.md', 'CHANGELOG.txt'
].each { path ->
if (!file(path).getText('UTF-8').contains('4.1.4.110021')) {
throw new GradleException("Authoritative release location does not contain 4.1.4.110021: ${path}")
if (!file(path).getText('UTF-8').contains('4.1.5.110021')) {
throw new GradleException("Authoritative release location does not contain 4.1.5.110021: ${path}")
}
}
if (!file('docs/API.md').getText('UTF-8').contains('orespawn@[4.0.6,5.0.0)')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ private static void writeHumanUpgradeReport(Path destination) throws IOException
}
}
List<String> lines = new ArrayList<>();
lines.add("OreSpawn 4.1.4.110021 Upgrade Report");
lines.add("OreSpawn 4.1.5.110021 Upgrade Report");
lines.add("================================");
lines.add("");
lines.add("RESULT: Legacy OreSpawn configuration was consumed and translated for OS4.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cyano/orespawn/OreSpawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class OreSpawn {
public static OreSpawn INSTANCE;
public static final String MODID = "orespawn";
public static final String NAME = "OreSpawn";
public static final String VERSION = "4.1.4.110021";
public static final String VERSION = "4.1.5.110021";
public static final List<Path> oreSpawnConfigFiles = new ArrayList<>();
public static final List<String> additionalStoneBlocks = new ArrayList<>();
public static boolean disableVanillaOreGen;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zone/moddev/mc/orespawn/OreSpawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class OreSpawn {

public static final String MODID = "orespawn";
public static final String NAME = "OreSpawn";
public static final String VERSION = "4.1.4.110021";
public static final String VERSION = "4.1.5.110021";

private static final Logger LOGGER = LogManager.getLogger();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static void writeUpgradeReport(Path worldRoot, Path configDirectory,
}

List<String> lines = new ArrayList<>();
lines.add("OreSpawn 4.1.4.110021 Upgrade Report");
lines.add("OreSpawn 4.1.5.110021 Upgrade Report");
lines.add("================================");
lines.add("");
lines.add("RESULT: Existing Mineralogy " + mineralogyVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static void writeInitialUpgradeReport(Path configDirectory,
boolean forceRetrogen, boolean flatBedrock, boolean retrogenBedrock,
int bedrockLayers) throws IOException {
String newline = System.lineSeparator();
String text = "OreSpawn 4.1.4.110021 Upgrade Report" + newline
String text = "OreSpawn 4.1.5.110021 Upgrade Report" + newline
+ "================================" + newline + newline
+ "RESULT: Legacy OreSpawn settings were imported into the OS4 profile." + newline
+ "- Manage vanilla ores: " + manageVanilla + newline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,26 @@ public void beforeVanillaOres(OreGenEvent.Pre event) {
public void filterVanillaOre(OreGenEvent.GenerateMinable event) {
if (WorldgenBenchmark.isVanillaBaseline()) return;
ResourceLocation dimension = WorldIds.dimension(event.getWorld());
Block output = vanillaOutput(event.getType());
if (WorldGeologyProfileManager.activeProfile().suppressAllOreFeatures()) {
event.setResult(Event.Result.DENY);
return;
}
Block output = vanillaOutput(event.getType());
if (output != null) {
} else if (output != null) {
ChunkPos chunk = new ChunkPos(event.getPos());
if (!OreSpawnOreGeneration.allowsVanillaOre(dimension, output,
event.getWorld().getSeed(), chunk.chunkXPos, chunk.chunkZPos)) {
event.setResult(Event.Result.DENY);
}
}

if (output == Blocks.GOLD_ORE && event.getResult() == Event.Result.DENY) {
VanillaMesaGoldCompatibility.suppress(event.getGenerator(), event.getWorld(), event.getPos());
}
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void afterBiomeDecoration(DecorateBiomeEvent.Post event) {
if (WorldgenBenchmark.isVanillaBaseline()) return;
VanillaMesaGoldCompatibility.restore(event.getWorld(), event.getPos());
}

@Override
Expand Down Expand Up @@ -114,6 +122,7 @@ private void generateOres(World world, int chunkX, int chunkZ, Random random) {
}

public void clear() {
VanillaMesaGoldCompatibility.clear();
AquiferMaterialSubstitution.clear();
earlyComplete.clear();
oreComplete.clear();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package zone.moddev.mc.orespawn.worldgen;

import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;

import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeMesa;
import net.minecraft.world.gen.feature.WorldGenerator;

/** Applies the normal gold decision to Mesa's extra, unhooked gold pass. */
final class VanillaMesaGoldCompatibility {

private static final WorldGenerator SKIPPED = new WorldGenerator() {
@Override
public boolean generate(World world, Random random, BlockPos pos) {
return false;
}
};

private static final Map<BiomeDecorator, SuppressedPass> suppressed = new IdentityHashMap<>();

private VanillaMesaGoldCompatibility() {
}

static void suppress(WorldGenerator generator, World world, BlockPos origin) {
if (generator == null || generator == SKIPPED) return;

// Mesa calls the same generator again after Forge's gold event. Match it
// by identity, not by a nearby biome, so chunk borders cannot pick the
// wrong decorator. No other ore generators or biome settings are changed.
for (Biome biome : Biome.REGISTRY) {
if (!(biome instanceof BiomeMesa)) continue;

BiomeDecorator decorator = biome.theBiomeDecorator;
if (decorator.goldGen == generator) {
suppressed.put(decorator, new SuppressedPass(generator, world, origin));
decorator.goldGen = SKIPPED;
}
}
}

static void restore(World world, BlockPos origin) {
Iterator<Map.Entry<BiomeDecorator, SuppressedPass>> iterator = suppressed.entrySet().iterator();

while (iterator.hasNext()) {
Map.Entry<BiomeDecorator, SuppressedPass> entry = iterator.next();
SuppressedPass pass = entry.getValue();

if (pass.world == world && pass.origin.equals(origin)) {
restore(entry.getKey(), pass);
iterator.remove();
}
}
}

static void clear() {
for (Map.Entry<BiomeDecorator, SuppressedPass> entry : suppressed.entrySet()) {
restore(entry.getKey(), entry.getValue());
}

suppressed.clear();
}

private static void restore(BiomeDecorator decorator, SuppressedPass pass) {
// Leave a replacement installed by another mod alone.
if (decorator.goldGen == SKIPPED) {
decorator.goldGen = pass.generator;
}
}

private static final class SuppressedPass {
final WorldGenerator generator;
final World world;
final BlockPos origin;

SuppressedPass(WorldGenerator generator, World world, BlockPos origin) {
this.generator = generator;
this.world = world;
this.origin = origin.toImmutable();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ void coordinatorRunsSurfacesBeforeManagedOresAndLeavesStaticBiomeListsAlone() th
"vanilla-ore suppression must make its decision at Forge's final standard event priority");
assertTrue(source.contains("OreSpawnOreGeneration.allowsVanillaOre(dimension, output"));
assertTrue(source.contains("event.setResult(Event.Result.DENY)"));
assertTrue(source.contains("output == Blocks.GOLD_ORE && event.getResult() == Event.Result.DENY"));
assertTrue(source.contains("VanillaMesaGoldCompatibility.suppress(event.getGenerator()"),
"Mesa's extra pass must use the same gold decision, not a second scaling roll");
assertTrue(source.contains("afterBiomeDecoration(DecorateBiomeEvent.Post event)"));
assertTrue(source.contains("VanillaMesaGoldCompatibility.restore(event.getWorld(), event.getPos())"));
assertTrue(source.contains("VanillaMesaGoldCompatibility.clear()"));
assertTrue(source.contains("earlyComplete.add(key)") && source.contains("oreComplete.add(key)"),
"terrain and ore callbacks must be independently deduplicated");
assertTrue(source("BiomeFeatureInstaller.java").contains("ordered terrain-event"),
Expand Down
Loading
Loading