Skip to content

Commit 098fd82

Browse files
committed
Keep existing provider settings
1 parent a886942 commit 098fd82

14 files changed

Lines changed: 138 additions & 18 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ jobs:
126126
if-no-files-found: error
127127
retention-days: 30
128128
path: |
129-
build/libs/OreSpawn-4.1.0.112021.jar
130-
build/libs/OreSpawn-4.1.0.112021-sources.jar
131-
build/libs/OreSpawn-4.1.0.112021-javadoc.jar
129+
build/libs/OreSpawn-4.1.1.112021.jar
130+
build/libs/OreSpawn-4.1.1.112021-sources.jar
131+
build/libs/OreSpawn-4.1.1.112021-javadoc.jar
132132
build/release/SHA256SUMS
133133
CHANGELOG.txt
134134

‎CHANGELOG.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 4.1.1.112021
2+
3+
* Keep existing provider settings when importing older ore files for the first
4+
time, instead of replacing them with the older settings.
5+
* Describe preserved settings as retained rather than verified in the upgrade
6+
report. Invalid files are still checked by the normal provider loader.
7+
18
Version 4.1.0.112021
29

310
* Clarify dimension-wide material controls and replace light-equivalent custom

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It gives mods and modpacks one place to configure ores, deposit shapes, optional
1010
rock strata and geomes, provider-owned underground fluid deposits, biome
1111
palettes and world materials, flat bedrock, and bounded ore retrogen.
1212

13-
This branch builds target-qualified version `4.1.0.112021`: the OreSpawn 4.1.0
13+
This branch builds target-qualified version `4.1.1.112021`: the OreSpawn 4.1.1
1414
feature set for Minecraft 1.12.2 and Forge. It adds stable generation identity,
1515
non-loading geology sampling, per-resource background control, existing-world
1616
provider merge policy, an Ore Sources arbiter for equivalent provider ores, a

‎docs/MIGRATION.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ legacy-ID behaviour.
8181
Migration is non-destructive. OreSpawn writes `config/orespawn-worldgen.json`
8282
only when that target does not already exist and retains every source file.
8383

84+
An existing `config/<modid>-orespawn.json` override is also kept unchanged,
85+
even when legacy files are imported for the first time. The upgrade report
86+
records that the existing provider settings were retained, not validated.
87+
An unfinished or invalid override is left for the normal provider validator;
88+
migration does not replace it with defaults or older settings.
89+
8490
When `config/mineralogy-geomes.json` exists, OreSpawn imports the Mineralogy 6
8591
profile directly, updates its schema marker, and records `migrated_from`.
8692

‎docs/VERSIONS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Examples:
5252
| Minecraft | Loader | Target | Example full OreSpawn version |
5353
| --- | --- | ---: | --- |
5454
| 1.10.2 | Forge | `110021` | `4.0.6.110021` |
55-
| 1.12.2 | Forge | `112021` | `4.1.0.112021` |
55+
| 1.12.2 | Forge | `112021` | `4.1.1.112021` |
5656
| 1.13.2 | Forge | `113021` | `4.0.6.113021` |
5757
| 1.20.6 | Forge | `120061` | `4.0.6.120061` |
5858
| 1.21.11 | Forge | `121111` | `4.0.6.121111` |

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mod_vendor=Minecraft Mod Development
3030
mod_license=LGPL-2.1
3131
mod_license_name=GNU Lesser General Public License, Version 2.1
3232
mod_license_url=https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
33-
mod_version=4.1.0.112021
33+
mod_version=4.1.1.112021
3434
mod_group=zone.moddev.mc.orespawn
3535
mod_authors=SkyBlade1978, dshadowwolf, the MMD Team
3636
mod_description=Configurable, provider-driven terrain, ore, and deposit generation.

‎gradle/release/artifacts.gradle‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ tasks.register('verifyReleaseConfiguration') {
8181
description = 'Validates the target-qualified release, API, schemas, reports, and publishing identity.'
8282

8383
doLast {
84-
if (project.mod_version != '4.1.0.112021'
84+
if (project.mod_version != '4.1.1.112021'
8585
|| project.mod_group != expectedMavenGroup) {
8686
throw new GradleException("Unexpected OreSpawn release version: ${project.mod_version}")
8787
}
@@ -108,8 +108,8 @@ tasks.register('verifyReleaseConfiguration') {
108108
'src/main/java/zone/moddev/mc/orespawn/worldgen/LegacyOs3ProfileMigration.java',
109109
'README.md', 'CHANGELOG.txt'
110110
].each { path ->
111-
if (!file(path).getText('UTF-8').contains('4.1.0.112021')) {
112-
throw new GradleException("Authoritative release location does not contain 4.1.0.112021: ${path}")
111+
if (!file(path).getText('UTF-8').contains('4.1.1.112021')) {
112+
throw new GradleException("Authoritative release location does not contain 4.1.1.112021: ${path}")
113113
}
114114
}
115115
if (!file('docs/API.md').getText('UTF-8').contains('orespawn@[4.0.6,5.0.0)')) {
@@ -173,7 +173,7 @@ tasks.register('verifyReleaseArtifacts') {
173173
}
174174
['src/test/', 'src/biomeIntegrationTest/', 'src/migrationIntegrationTest/',
175175
'src/clientIntegrationTest/', 'src/os1AbiFixture/', 'src/os3AbiFixture/',
176-
'agent-notes/', 'surfaceprobe', 'migrationprobe', 'clientprobe',
176+
'agent-notes/', 'AGENTS.md', 'AGENT.md', 'surfaceprobe', 'migrationprobe', 'clientprobe',
177177
'codec-conflict/', 'LegacyApiConsumer', 'OreSourceEditorProbeBridge',
178178
'org/junit/', 'org/mockito/', 'net/bytebuddy/'].each { forbidden ->
179179
if (candidateZip.entries().any { it.name.contains(forbidden) }) {

‎src/main/java/com/mcmoddev/orespawn/compat/LegacyOs3Bridge.java‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private static void migrateConfigDirectory(Path configDirectory) {
335335
}
336336
for (Map.Entry<String, JsonObject> provider : providers.entrySet()) {
337337
try {
338-
writeAtomicIfChanged(configDirectory.resolve(provider.getKey() + "-orespawn.json"), provider.getValue());
338+
writeProviderIfAbsent(configDirectory.resolve(provider.getKey() + "-orespawn.json"), provider.getValue());
339339
} catch (IOException failure) {
340340
REPORT.add("provider_write_failed=" + provider.getKey() + ":" + failure.getClass().getSimpleName());
341341
LOGGER.error("Could not write migrated OS3 provider {}", provider.getKey(), failure);
@@ -792,6 +792,16 @@ private static int metadata(String block, String state) {
792792
return 0;
793793
}
794794

795+
static void writeProviderIfAbsent(Path destination, JsonObject value) throws IOException {
796+
// An existing OS4 file is a pack's choice, even on its first legacy import.
797+
if (Files.isRegularFile(destination)) {
798+
REPORT.add("provider_preserved=" + destination.getFileName());
799+
return;
800+
}
801+
802+
writeAtomicIfChanged(destination, value);
803+
}
804+
795805
private static void writeAtomicIfChanged(Path destination, JsonObject value) throws IOException {
796806
byte[] data = (GSON.toJson(value) + System.lineSeparator()).getBytes(StandardCharsets.UTF_8);
797807
if (Files.isRegularFile(destination) && Arrays.equals(Files.readAllBytes(destination), data)) {
@@ -833,7 +843,8 @@ private static void writeHumanUpgradeReport(Path destination) throws IOException
833843
String lower = row.toLowerCase(java.util.Locale.ROOT);
834844
if (lower.startsWith("config_source=") || lower.startsWith("resource_loaded=")
835845
|| lower.startsWith("config_registered=")) sources.add(row);
836-
if ((lower.startsWith("provider_written=") || lower.startsWith("provider_unchanged="))
846+
if ((lower.startsWith("provider_written=") || lower.startsWith("provider_unchanged=")
847+
|| lower.startsWith("provider_preserved="))
837848
&& !lower.contains("migration-report")) providers.add(row);
838849
if (lower.contains("_failed=") || lower.contains("_rejected=")
839850
|| lower.contains("_ignored=") || lower.contains("_unresolved=")
@@ -842,12 +853,12 @@ private static void writeHumanUpgradeReport(Path destination) throws IOException
842853
}
843854
}
844855
List<String> lines = new ArrayList<>();
845-
lines.add("OreSpawn 4.1.0.112021 Upgrade Report");
856+
lines.add("OreSpawn 4.1.1.112021 Upgrade Report");
846857
lines.add("================================");
847858
lines.add("");
848859
lines.add("RESULT: Legacy OreSpawn configuration was consumed and translated for OS4.");
849860
lines.add("- Legacy sources read: " + sources.size());
850-
lines.add("- OS4 provider files written or verified: " + providers.size());
861+
lines.add("- OS4 provider files written or retained: " + providers.size());
851862
lines.add("- Unique items requiring review: " + warnings.size());
852863
lines.add("");
853864
lines.add(warnings.isEmpty()

‎src/main/java/zone/moddev/mc/orespawn/OreSpawn.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class OreSpawn {
5252

5353
public static final String MODID = "orespawn";
5454
public static final String NAME = "OreSpawn";
55-
public static final String VERSION = "4.1.0.112021";
55+
public static final String VERSION = "4.1.1.112021";
5656

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

‎src/main/java/zone/moddev/mc/orespawn/worldgen/LegacyMineralogyProfileMigration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private static void writeUpgradeReport(Path worldRoot, Path configDirectory,
152152
Path report = worldRoot.resolve("serverconfig/orespawn-upgrade-report.txt");
153153
List<String> missing = missingBlocks(igneous, metamorphic, sedimentary);
154154
List<String> lines = new ArrayList<>();
155-
lines.add("OreSpawn 4.1.0.112021 Upgrade Report");
155+
lines.add("OreSpawn 4.1.1.112021 Upgrade Report");
156156
lines.add("================================");
157157
lines.add("");
158158
lines.add("RESULT: Existing Mineralogy " + identity.version + " world detected.");

0 commit comments

Comments
 (0)