From fb6eb7e61afaac7dbbd974b83ea78fc0bd8a432f Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Sun, 15 Nov 2026 08:18:43 +0000 Subject: [PATCH] Fix Forge 1.13 fluid loading and update OreSpawn --- .github/workflows/ci.yml | 6 +++--- CHANGELOG.txt | 5 +++++ README.md | 4 ++-- build.gradle | 13 ++++++++++--- docs/DEVELOPER_GUIDE.md | 2 +- docs/PLAYER_GUIDE.md | 2 +- docs/VERSIONS.md | 18 +++++++++--------- gradle.properties | 8 ++++---- .../zone/moddev/mc/mineralogy/Mineralogy.java | 2 -- .../mineralogy/fluids/MineralogyFluids.java | 10 ++++------ src/main/resources/META-INF/mods.toml | 2 +- .../mc/mineralogy/ResourceContractTest.java | 6 +++--- .../mc/mineralogy/WorkflowContractTest.java | 2 +- tools/test_fluid_registration.js | 19 +++++++++++++++++++ 14 files changed, 63 insertions(+), 36 deletions(-) create mode 100644 tools/test_fluid_registration.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b412748e1..5885aa47f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,9 +62,9 @@ jobs: if-no-files-found: error retention-days: 30 path: | - build/libs/Mineralogy-6.0.1.113021.jar - build/libs/Mineralogy-6.0.1.113021-sources.jar - build/libs/Mineralogy-6.0.1.113021-javadoc.jar + build/libs/Mineralogy-6.0.2.113021.jar + build/libs/Mineralogy-6.0.2.113021-sources.jar + build/libs/Mineralogy-6.0.2.113021-javadoc.jar build/release/SHA256SUMS CHANGELOG.txt diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7f7456019..994482970 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +Mineralogy 6.0.2.113021 for Minecraft 1.13.2 + +- Use OreSpawn 4.1.7 for the latest world generation and saved-profile fixes. +- Fix missing fluids and startup hangs with other fluid-adding mods during parallel loading. + Mineralogy 6.0.1.113021 for Minecraft 1.13.2 - Delegated terrain, strata, ore, and covered fluid-deposit generation to the diff --git a/README.md b/README.md index c42862329..49a2dc059 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ mineral ores and dusts, rock furnaces, drywall, rock-salt lighting, fertilizer, and crude oil. OreSpawn 4 is the sole terrain, strata, ore, and deposit engine; Mineralogy no longer installs a parallel world generator. -This branch builds Mineralogy `6.0.1.113021` for Forge `25.0.223` and requires -OreSpawn `4.0.6` or another compatible 4.x release. Install both mods on clients +This branch builds Mineralogy `6.0.2.113021` for Forge `25.0.223` and requires +OreSpawn `4.1.7.113021` or a later compatible 1.13.2 release. Install both mods on clients and servers. ## Configuration and help diff --git a/build.gradle b/build.gradle index 105df30e5..221aa3c67 100644 --- a/build.gradle +++ b/build.gradle @@ -286,7 +286,7 @@ task verifyReleaseDependencies { group = 'verification' description = 'Resolves and verifies the exact released OreSpawn dependency.' doLast { - if (project.mod_version != '6.0.1.113021' + if (project.mod_version != '6.0.2.113021' || project.minecraft_version != project.mc_version || project.mc_version != '1.13.2' || project.loader_name != 'forge' @@ -297,9 +297,9 @@ task verifyReleaseDependencies { || project.curseforge_project_id != '240974') { throw new GradleException('Unexpected generic release dispatcher metadata') } - if (project.orespawn_version != '4.0.6.113021' || + if (project.orespawn_version != '4.1.7.113021' || project.orespawn_curse_project_id != '245586' || - project.orespawn_curse_file_id != '8681710') { + project.orespawn_curse_file_id != '9611746') { throw new GradleException('Unexpected OreSpawn release coordinates') } File artifact = configurations.orespawnRelease.resolvedConfiguration.resolvedArtifacts @@ -609,3 +609,10 @@ tasks.matching { it.name == 'eclipse' }.all { } check.dependsOn verifyReleaseDependencies + +task verifyFluidRegistration(type: Exec) { + group = 'verification' + description = 'Checks that oil registration runs before blocks, outside parallel construction.' + commandLine 'node', '--test', 'tools/test_fluid_registration.js' +} +check.dependsOn verifyFluidRegistration diff --git a/docs/DEVELOPER_GUIDE.md b/docs/DEVELOPER_GUIDE.md index 3ba3b962e..3a7f967c9 100644 --- a/docs/DEVELOPER_GUIDE.md +++ b/docs/DEVELOPER_GUIDE.md @@ -9,7 +9,7 @@ | Forge tag identities and old-save compatibility | Ore and fluid-deposit placement | | Mineralogy's provider declaration and migration | Profiles, UI, retrogen, and templates | -Mineralogy requires OreSpawn `[4.0.6,5.0.0)`. Reusable worldgen integrations +Mineralogy requires OreSpawn `[4.1.7.113021,5.0.0)`. Reusable worldgen integrations belong in `zone.moddev.mc.orespawn.api` or an OreSpawn provider rather than Mineralogy internals. diff --git a/docs/PLAYER_GUIDE.md b/docs/PLAYER_GUIDE.md index a8e2c1d0c..6df566ad2 100644 --- a/docs/PLAYER_GUIDE.md +++ b/docs/PLAYER_GUIDE.md @@ -3,7 +3,7 @@ ## Installing Mineralogy 6 needs Minecraft 1.13.2, Forge 25.0.223, and OreSpawn -4.0.6.113021. +4.1.7.113021 or a later compatible 1.13.2 release. Install matching Mineralogy and OreSpawn jars on both clients and servers. Do not open a world containing Mineralogy blocks without Mineralogy installed. diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 70dd04a41..79fe6e707 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -9,14 +9,14 @@ exact Minecraft/loader target are both visible in one number. Major.Minor.Bug.Target ``` -The first three components are the **functional version**. Mineralogy `6.0.1` -means major generation 6, minor release 0, and bug revision 1. +The first three components are the **functional version**. Mineralogy `6.0.2` +means major generation 6, minor release 0, and bug revision 2. The fourth component identifies the target build. The complete version for this Minecraft 1.13.2 Forge release is therefore: ```text -6.0.1.113021 +6.0.2.113021 ``` This expanded numeric form is compatible with Maven version ordering, but it @@ -25,7 +25,7 @@ components. The release tag is exactly the complete four-component version, with no redundant Minecraft-version prefix. For this branch the tag is therefore -`6.0.1.113021`, not `1.13.2-6.0.1.113021`. The Target already makes tags unique +`6.0.2.113021`, not `1.13.2-6.0.2.113021`. The Target already makes tags unique across Minecraft versions and loaders. ## Reading the target component @@ -142,11 +142,11 @@ example, `[6.0.0,7.0.0)` accepts target-qualified Mineralogy 6 releases while excluding Mineralogy 7. Minecraft and loader metadata still decide whether a particular jar can load on the current game. -Mineralogy 6 also requires OreSpawn `[4.0.6,5.0.0)`. OreSpawn uses the same +Mineralogy 6 also requires OreSpawn `[4.1.7.113021,5.0.0)`. OreSpawn uses the same target calculation, so the matching Minecraft 1.13.2 Forge release is -`4.0.6.113021`. The dependency range deliberately describes the supported -functional OreSpawn generation; Forge still prevents jars for another -Minecraft target from loading together. +`4.1.7.113021`. This minimum includes the saved-profile, retrogen and +generation-boundary fixes tested with this build. Forge also prevents jars +for another Minecraft target from loading together. Pack maintainers should record the complete four-component versions in pack manifests and support reports. Saying only “Mineralogy 6” identifies the @@ -157,7 +157,7 @@ feature generation, not the exact jar. The Gradle build reads the complete version from `mod_version`, verifies that it has four numeric components, and checks that its Target matches the declared Minecraft version and Forge loader. CI build numbers are not appended. For this -branch, published metadata and artifacts therefore use `6.0.1.113021`. +branch, published metadata and artifacts therefore use `6.0.2.113021`. Every release note should state: diff --git a/gradle.properties b/gradle.properties index ea6fea252..bbdeb9063 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -mod_version=6.0.1.113021 +mod_version=6.0.2.113021 mod_group=zone.moddev.mc # Release metadata consumed by the generic dispatcher. @@ -21,7 +21,7 @@ mcp_mappings_channel=snapshot mcp_mappings_version=20180921-1.13 mcp_version=20190213.203750 -orespawn_version=4.0.6.113021 +orespawn_version=4.1.7.113021 orespawn_curse_project_id=245586 -orespawn_curse_file_id=8681710 -orespawn_sha256=5506581A0B6CF7ED97AF8AEA8254353D3F0BD774ADD318550AE251045CCED5A0 +orespawn_curse_file_id=9611746 +orespawn_sha256=E65DCCA0623A20111C40779CB0FE2078E98C618FAA68F79C9A28E1E53C63957E diff --git a/src/main/java/zone/moddev/mc/mineralogy/Mineralogy.java b/src/main/java/zone/moddev/mc/mineralogy/Mineralogy.java index 0b9ac7cff..e69d2d643 100644 --- a/src/main/java/zone/moddev/mc/mineralogy/Mineralogy.java +++ b/src/main/java/zone/moddev/mc/mineralogy/Mineralogy.java @@ -2,7 +2,6 @@ import zone.moddev.mc.mineralogy.compat.CobblestoneTagPolicy; import zone.moddev.mc.mineralogy.documentation.DocumentationExporter; -import zone.moddev.mc.mineralogy.fluids.MineralogyFluids; import zone.moddev.mc.mineralogy.migration.LegacyOreConfigMigrator; import zone.moddev.mc.mineralogy.patching.LegacyWorldDataHook; import net.minecraftforge.common.MinecraftForge; @@ -33,7 +32,6 @@ private static String getVersion() { public Mineralogy() { instance = this; - MineralogyFluids.registerFluids(); DistExecutor.runWhenOn(Dist.CLIENT, () -> zone.moddev.mc.mineralogy.client.ClientOilRenderer::register); LegacyWorldDataHook.register(); diff --git a/src/main/java/zone/moddev/mc/mineralogy/fluids/MineralogyFluids.java b/src/main/java/zone/moddev/mc/mineralogy/fluids/MineralogyFluids.java index ae069e2be..fd4a5e985 100644 --- a/src/main/java/zone/moddev/mc/mineralogy/fluids/MineralogyFluids.java +++ b/src/main/java/zone/moddev/mc/mineralogy/fluids/MineralogyFluids.java @@ -39,12 +39,9 @@ public final class MineralogyFluids { private MineralogyFluids() { } - /** - * Forge 25 still uses Minecraft's vanilla fluid registry. Register the two - * fluid states during mod construction, before Forge fires block and item - * registry events. - */ - public static void registerFluids() { + // Forge 25's vanilla fluid registries are not thread-safe. The sequential + // block event lets us bind the oil before creating its block and bucket. + private static void registerFluids() { if (CRUDE_OIL != null) { return; } @@ -61,6 +58,7 @@ public static void registerFluids() { @SubscribeEvent public static void registerBlock(RegistryEvent.Register event) { + registerFluids(); CRUDE_OIL_BLOCK = (BlockFlowingFluid) new CrudeOilBlock(CRUDE_OIL, Block.Properties.create(Material.WATER).doesNotBlockMovement() .hardnessAndResistance(100.0F).variableOpacity()) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 838744c65..58a1f528b 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -25,7 +25,7 @@ Fills the world with real-world rocks. [[dependencies.mineralogy]] modId="orespawn" mandatory=true - versionRange="[4.0.6,5.0.0)" + versionRange="[4.1.7.113021,5.0.0)" ordering="AFTER" side="BOTH" diff --git a/src/test/java/zone/moddev/mc/mineralogy/ResourceContractTest.java b/src/test/java/zone/moddev/mc/mineralogy/ResourceContractTest.java index 405eed630..e9d52ac40 100644 --- a/src/test/java/zone/moddev/mc/mineralogy/ResourceContractTest.java +++ b/src/test/java/zone/moddev/mc/mineralogy/ResourceContractTest.java @@ -155,15 +155,15 @@ public void allSeventeenLocalesHaveOrdered938KeyParity() throws Exception { @Test public void oilAndBuildMetadataUseStableTargetIdentities() throws Exception { String properties = new String(Files.readAllBytes(new File("gradle.properties").toPath()), StandardCharsets.UTF_8); - assertTrue(properties.contains("mod_version=6.0.1.113021")); - assertTrue(properties.contains("orespawn_curse_file_id=8681710")); + assertTrue(properties.contains("mod_version=6.0.2.113021")); + assertTrue(properties.contains("orespawn_curse_file_id=9611746")); String build = new String(Files.readAllBytes(new File("build.gradle").toPath()), StandardCharsets.UTF_8); assertTrue(build.contains("runtime fg.deobf")); assertTrue(build.contains("orespawnRelease")); String metadata = new String(Files.readAllBytes(new File(ROOT, "META-INF/mods.toml").toPath()), StandardCharsets.UTF_8); assertTrue(metadata.contains("loaderVersion=\"[25,)\"")); assertTrue(metadata.contains("versionRange=\"[25.0.223,26)\"")); - assertTrue(metadata.contains("versionRange=\"[4.0.6,5.0.0)\"")); + assertTrue(metadata.contains("versionRange=\"[4.1.7.113021,5.0.0)\"")); assertTrue(metadata.contains("ordering=\"AFTER\"")); assertTrue(new File(ROOT, "assets/mineralogy/textures/items/crude_oil_bucket.png").isFile()); assertTrue(new File(ROOT, "assets/mineralogy/textures/blocks/crude_oil_still.png").isFile()); diff --git a/src/test/java/zone/moddev/mc/mineralogy/WorkflowContractTest.java b/src/test/java/zone/moddev/mc/mineralogy/WorkflowContractTest.java index b67b3a526..aefb7e29e 100644 --- a/src/test/java/zone/moddev/mc/mineralogy/WorkflowContractTest.java +++ b/src/test/java/zone/moddev/mc/mineralogy/WorkflowContractTest.java @@ -19,7 +19,7 @@ public void releaseMetadataIdentifiesTheGenericForgeTarget() throws Exception { try (FileInputStream input = new FileInputStream("gradle.properties")) { properties.load(input); } - assertEquals("6.0.1.113021", properties.getProperty("mod_version")); + assertEquals("6.0.2.113021", properties.getProperty("mod_version")); assertEquals("1.13.2", properties.getProperty("minecraft_version")); assertEquals(properties.getProperty("mc_version"), properties.getProperty("minecraft_version")); assertEquals("forge", properties.getProperty("loader_name")); diff --git a/tools/test_fluid_registration.js b/tools/test_fluid_registration.js new file mode 100644 index 000000000..219021534 --- /dev/null +++ b/tools/test_fluid_registration.js @@ -0,0 +1,19 @@ +const assert = require('node:assert/strict'); +const test = require('node:test'); +const fs = require('node:fs'); +const path = require('node:path'); +const root = path.join(__dirname, '../src/main/java/zone/moddev/mc/mineralogy'); +const mod = fs.readFileSync(path.join(root, 'Mineralogy.java'), 'utf8'); +const fluids = fs.readFileSync(path.join(root, 'fluids/MineralogyFluids.java'), 'utf8'); + +test('parallel construction does not write the shared fluid registry', () => { + assert.ok(!/registerFluids\s*\(/.test(mod)); +}); +test('the sequential block event registers oil before creating its block', () => { + assert.ok(/@SubscribeEvent\s+public static void registerBlock\(RegistryEvent\.Register event\)\s*\{\s*registerFluids\(\);/.test(fluids)); + assert.equal((fluids.match(/registerFluids\(\);/g) || []).length, 1); +}); +test('fluid registration is private and remains idempotent', () => { + assert.ok(/private static void registerFluids\(\)/.test(fluids)); + assert.ok(/if \(CRUDE_OIL != null\)/.test(fluids)); +});