Skip to content

Commit 1d6cc45

Browse files
authored
Fix ore generation and upgrades on 1.13.2
Bring the recent Ore Sources, vanilla ore and saved-world fixes to Forge 1.13.2.
2 parents 6a7c2bb + b310dad commit 1d6cc45

38 files changed

Lines changed: 1254 additions & 736 deletions

‎.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.113021.jar
130-
build/libs/OreSpawn-4.1.0.113021-sources.jar
131-
build/libs/OreSpawn-4.1.0.113021-javadoc.jar
129+
build/libs/OreSpawn-4.1.6.113021.jar
130+
build/libs/OreSpawn-4.1.6.113021-sources.jar
131+
build/libs/OreSpawn-4.1.6.113021-javadoc.jar
132132
build/release/SHA256SUMS
133133
CHANGELOG.txt
134134

‎CHANGELOG.txt‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Version 4.1.6.113021
2+
3+
* Leave vanilla ores to Minecraft when Manage Vanilla Ores is off. When
4+
it is on, an imported rule takes over without an extra copy of the ore.
5+
* Keep saved Ore Sources choices for imported patterns. Built-in patterns
6+
share the standard channel for new choices; custom channels stay separate.
7+
* Show vanilla ores in Ore Sources before creating a world, even when Manage
8+
Vanilla Ores is off.
9+
* Keep imported provider rules when opening a saved world. Back up the
10+
profile before removing an untouched duplicate; keep edited rules for review.
11+
* Choose sulfur and lithium defaults after mods have loaded, including Base
12+
Electric. Existing worlds keep their choices.
13+
* Fix the Austrian German language ID and add Pirate Speak menu and guide text.
14+
115
Version 4.1.0.113021
216

317
* Fix managed Nether quartz hosts on Forge 1.13.2, including saved profiles

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ End" policy used by mods such as Base Metals.
1717
This is not the unrelated mod that adds mobs and dimensions under the same
1818
name.
1919

20-
This branch builds target-qualified version `4.1.0.113021` for Minecraft 1.13.2
20+
This branch builds target-qualified version `4.1.6.113021` for Minecraft 1.13.2
2121
and Forge. It adds material-group ore arbitration, exact biome replacements,
2222
and a directory for installed provider mods to the OreSpawn 4.0.16 base. See the
2323
[versioning policy](docs/VERSIONS.md) for the encoding and release convention.

‎docs/CONFIGURATION.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ Each enabled ore dimension uses:
185185
| `placement_channel` | registry ID | Independent placement budget shared by equivalent ores in consolidated modes |
186186

187187
At least one of `host_families`, `host_blocks`, or `host_tags` must be present.
188+
On 1.13.2, plain stone, granite, diorite, and andesite are separate block
189+
IDs. Use `host_blocks: ["minecraft:stone"]` for plain stone only; no
190+
pre-flattening metadata is needed.
188191

189192
On Forge 1.13.2, the default Nether quartz rule uses
190193
`host_blocks: ["minecraft:netherrack"]`, because Forge does not ship a

‎docs/MIGRATION.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ and are called out in `orespawn-migration/migration-report.txt` for manual
1111
review. Files owned by mods without an active provider retain the original
1212
legacy-ID behaviour.
1313

14+
Importing a rule does not turn on **Manage Vanilla Ores**. With that
15+
setting off, Minecraft still generates its own ores and the imported vanilla
16+
rules remain available in the profile for later use. Turning it on lets an
17+
active imported rule replace the modern default for that ore and dimension.
18+
19+
If a saved world has a proven legacy rule and an unchanged duplicate from the
20+
same provider, OreSpawn keeps the imported rule and backs up the profile as
21+
`serverconfig/orespawn-worldgen.pre-legacy-ore-repair.bak` before removing the
22+
duplicate. Edited or ambiguous rules are kept and noted in the log. Old
23+
metadata is not used to guess a new block ID, and existing chunks are not
24+
regenerated by the repair.
25+
1426
Migration is non-destructive. OreSpawn writes `config/orespawn-worldgen.json`
1527
only when that target does not already exist and retains every source file.
1628
When legacy OreSpawn rules are translated, a concise player-facing summary is

‎docs/PROVIDERS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,8 @@ referenced biome; ordinary compatibility hints belong in `similar_biomes`.
124124
See `examples/examplemod-orespawn.json` for rocks, weighted ore output, a
125125
fluid deposit, a custom dimension, biome palette, world materials, and a
126126
selectable template.
127+
128+
Ore Sources chooses defaults once mods finish loading. Both `baseelectric`
129+
and `electricadvantage` are recognised for sulfur and lithium, but
130+
automatic balancing still requires loaded providers with an exact shared
131+
ore tag. Existing worlds keep their saved choices.

‎docs/VERSIONS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Examples:
5151

5252
| Minecraft | Loader | Target | Example full OreSpawn version |
5353
| --- | --- | ---: | --- |
54-
| 1.13.2 | Forge | `113021` | `4.1.0.113021` |
54+
| 1.13.2 | Forge | `113021` | `4.1.6.113021` |
5555
| 1.20.6 | Forge | `120061` | `4.0.6.120061` |
5656
| 1.21.11 | Forge | `121111` | `4.0.6.121111` |
5757
| 26.1.2 | Forge | `2601021` | `4.0.6.2601021` |

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mcp_version=20190213.203750
1919
mod_id=orespawn
2020
mod_name=MMD OreSpawn
2121
mod_license=LGPL-2.1
22-
mod_version=4.1.0.113021
22+
mod_version=4.1.6.113021
2323
mod_group=zone.moddev.mc.orespawn
2424
mod_authors=SkyBlade1978, dshadowwolf, the MMD Team
2525
mod_description=Configurable, provider-driven terrain, ore, and deposit generation.

‎gradle/release/artifacts.gradle‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def preparedReleaseDir = providers.gradleProperty('preparedReleaseDir')
8181
tasks.register('verifyReleaseConfiguration') {
8282
group = 'verification'
8383
doLast {
84-
if (project.mod_version != '4.1.0.113021'
84+
if (project.mod_version != '4.1.6.113021'
8585
|| project.mod_group != expectedMavenGroup
8686
|| project.minecraft_version != '1.13.2'
8787
|| project.forge_version != '25.0.223'
@@ -95,9 +95,9 @@ tasks.register('verifyReleaseConfiguration') {
9595
throw new GradleException('Unexpected dispatcher or Java target metadata')
9696
}
9797
List<String> expectedPublicArtifacts = [
98-
'OreSpawn-4.1.0.113021.jar',
99-
'OreSpawn-4.1.0.113021-sources.jar',
100-
'OreSpawn-4.1.0.113021-javadoc.jar'
98+
'OreSpawn-4.1.6.113021.jar',
99+
'OreSpawn-4.1.6.113021-sources.jar',
100+
'OreSpawn-4.1.6.113021-javadoc.jar'
101101
]
102102
if (base.archivesName.get() != expectedMavenArtifact
103103
|| expectedReleaseFiles.get().collect { it.toString() } != expectedPublicArtifacts) {
@@ -114,7 +114,7 @@ tasks.register('verifyReleaseConfiguration') {
114114
'src/main/java/zone/moddev/mc/orespawn/worldgen/LegacyMineralogyProfileMigration.java',
115115
'README.md', 'CHANGELOG.txt'
116116
].each { path ->
117-
if (!file(path).getText('UTF-8').contains('4.1.0.113021')) {
117+
if (!file(path).getText('UTF-8').contains('4.1.6.113021')) {
118118
throw new GradleException("Release identity missing from ${path}")
119119
}
120120
}

‎src/clientIntegrationTest/java/zone/moddev/mc/orespawn/client/ClientProbeTestMod.java‎

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import net.minecraft.client.gui.GuiCreateWorld;
1818
import net.minecraft.client.gui.GuiMainMenu;
1919
import net.minecraft.client.gui.GuiScreen;
20+
import net.minecraft.client.resources.I18n;
2021
import net.minecraft.util.text.TextFormatting;
2122
import net.minecraft.world.GameType;
2223
import net.minecraft.world.WorldSettings;
@@ -48,6 +49,7 @@ public final class ClientProbeTestMod {
4849
private boolean worldSettingsOpened;
4950
private boolean longEditorRoundTrip;
5051
private boolean oreSourceFixturesVerified;
52+
private boolean vanillaOreSourcesVerified;
5153
private List<GuiButton> worldCreationButtons;
5254

5355
public ClientProbeTestMod() {
@@ -117,6 +119,21 @@ private void handleClientTick() {
117119
worldSettingsOpened = true;
118120
validateCaptions((OreSpawnWorldSettingsScreen) minecraft.currentScreen);
119121
validateLongEditorRoundTrip(minecraft, minecraft.currentScreen);
122+
String localizedCaption = System.getProperty("clientprobe.recommendedCaption", "");
123+
if (!localizedCaption.isEmpty()) {
124+
String actual = I18n.format("button.orespawn.recommended");
125+
if (!localizedCaption.equals(actual)) {
126+
throw new IllegalStateException("Unexpected Recommended Defaults caption: " + actual);
127+
}
128+
Properties values = new Properties();
129+
values.setProperty("recommended", actual);
130+
try (FileOutputStream output = new FileOutputStream("client-locale-pass.properties")) {
131+
values.store(output, "OreSpawn localized editor check");
132+
}
133+
minecraft.shutdown();
134+
nextState(10);
135+
break;
136+
}
120137
if (Boolean.getBoolean("clientprobe.oreSourcesFixtures")) {
121138
validateOreSourceFixtures(minecraft, minecraft.currentScreen);
122139
oreSourceFixturesVerified = true;
@@ -202,8 +219,8 @@ private Button nextNavigationButton(OreSpawnWorldSettingsScreen root) {
202219
Button button = (Button) widget;
203220
String caption = TextFormatting.getTextWithoutFormattingCodes(button.getMessage());
204221
if (!attemptedButtons.add(caption)) continue;
205-
String lower = caption.toLowerCase(java.util.Locale.ROOT);
206-
if (lower.equals("done") || lower.equals("cancel") || lower.contains("recommended")) continue;
222+
if (I18n.format("gui.done").equals(caption) || I18n.format("gui.cancel").equals(caption)
223+
|| I18n.format("button.orespawn.recommended").equals(caption)) continue;
207224
return button;
208225
}
209226
return null;
@@ -224,7 +241,7 @@ private static void validateCaptions(OreSpawnScreen screen) {
224241
}
225242
}
226243

227-
private static void validateOreSourcesRoute(Minecraft minecraft, OreSpawnScreen materials) {
244+
private void validateOreSourcesRoute(Minecraft minecraft, OreSpawnScreen materials) {
228245
Button ores = buttonWithCaption(materials,
229246
net.minecraft.client.resources.I18n.format("tab.orespawn.ores"));
230247
if (ores == null) throw new IllegalStateException("Missing ORES tab");
@@ -239,6 +256,10 @@ private static void validateOreSourcesRoute(Minecraft minecraft, OreSpawnScreen
239256
throw new IllegalStateException("Ore Sources route did not open");
240257
}
241258
OreSourceListScreen opened = (OreSourceListScreen) minecraft.currentScreen;
259+
if (!vanillaOreSourcesVerified && Boolean.getBoolean("clientprobe.vanillaOreSources")) {
260+
validateVanillaOreSources(opened);
261+
vanillaOreSourcesVerified = true;
262+
}
242263
validateEmptyOreSources(minecraft, materials);
243264
Button addGroup = buttonWithCaption(opened, "+");
244265
if (addGroup == null) throw new IllegalStateException("Missing Add Group control");
@@ -254,6 +275,55 @@ private static void validateOreSourcesRoute(Minecraft minecraft, OreSpawnScreen
254275
}
255276
}
256277

278+
private static void validateVanillaOreSources(OreSourceListScreen screen) {
279+
WorldGeologyProfile pending = WorldGeologyProfileManager.pendingNewWorldProfile();
280+
if (pending.manageVanillaOres()) {
281+
throw new IllegalStateException("The standalone Show All check must run with vanilla management off");
282+
}
283+
validateVanillaOreRows(screen);
284+
GeologyEditorSession session = new GeologyEditorSession(pending);
285+
JsonObject before = session.profile().rootCopy();
286+
for (GeologyEditorSession.OreSourceGroup group : session.oreSourceGroups()) {
287+
if (group.hasManagedPlacementSource() || !"keep_separate".equals(group.mode)) {
288+
throw new IllegalStateException("Show All should not put OreSpawn in charge of vanilla generation");
289+
}
290+
}
291+
if (!before.equals(session.profile().rootCopy())) {
292+
throw new IllegalStateException("Listing vanilla ores must not change the profile");
293+
}
294+
System.out.println("VANILLA_ORE_SOURCES_PASS management=off rows=8 profile=unchanged");
295+
}
296+
297+
private static void validateVanillaOreRows(OreSourceListScreen screen) {
298+
if (firstList(screen).size() != 0) {
299+
throw new IllegalStateException("Routine vanilla ores should start hidden");
300+
}
301+
Button showAll = buttonWithCaption(screen, I18n.format("button.orespawn.show_all"));
302+
if (showAll == null) throw new IllegalStateException("Missing Show All control");
303+
((GuiButton) showAll).onClick(0, 0);
304+
CompactScrollList groups = firstList(screen);
305+
String[] expected = { "Coal", "Diamond", "Emerald", "Gold", "Iron", "Lapis", "Quartz", "Redstone" };
306+
if (groups.size() != expected.length) {
307+
throw new IllegalStateException("Show All should list eight vanilla ores, found " + groups.size());
308+
}
309+
for (int row = 0; row < expected.length; row++) {
310+
if (!groups.rowText(row).startsWith(expected[row] + " - ")) {
311+
throw new IllegalStateException("Unexpected vanilla ore row: " + groups.rowText(row));
312+
}
313+
}
314+
Button hideSingles = buttonWithCaption(screen, I18n.format("button.orespawn.ore_source.hide_single"));
315+
if (hideSingles == null) throw new IllegalStateException("Missing Hide Singles control");
316+
((GuiButton) hideSingles).onClick(0, 0);
317+
if (firstList(screen).size() != 0) throw new IllegalStateException("Hide Singles should hide vanilla ores");
318+
}
319+
320+
private static CompactScrollList firstList(OreSpawnScreen screen) {
321+
for (GuiButton widget : screen.qualificationButtons()) {
322+
if (widget instanceof CompactScrollList) return (CompactScrollList) widget;
323+
}
324+
throw new IllegalStateException("Missing Groups list");
325+
}
326+
257327
private static void validateEmptyOreSources(Minecraft minecraft, GuiScreen parent) {
258328
for (int[] size : new int[][] { { 426, 265 }, { 320, 240 } }) {
259329
OreSourceListScreen empty = new OreSourceListScreen(parent,
@@ -440,7 +510,7 @@ private static void pressDone(OreSpawnScreen screen) {
440510
for (GuiButton widget : screen.qualificationButtons()) {
441511
if (!(widget instanceof Button)) continue;
442512
String caption = TextFormatting.getTextWithoutFormattingCodes(((Button) widget).getMessage());
443-
if ("done".equalsIgnoreCase(caption)) {
513+
if (I18n.format("gui.done").equals(caption)) {
444514
((GuiButton) widget).onClick(0, 0);
445515
return;
446516
}
@@ -462,6 +532,7 @@ private void writeMarker() throws IOException {
462532
values.setProperty("world_settings_opened", Boolean.toString(worldSettingsOpened));
463533
values.setProperty("long_editor_roundtrip", Boolean.toString(longEditorRoundTrip));
464534
values.setProperty("ore_source_fixtures_verified", Boolean.toString(oreSourceFixturesVerified));
535+
values.setProperty("vanilla_ore_sources_verified", Boolean.toString(vanillaOreSourcesVerified));
465536
values.setProperty("editor_routes", Integer.toString(editorRoutes.size()));
466537
values.setProperty("editor_classes", editorRoutes.toString());
467538
values.setProperty("first_world_rendered", Boolean.toString(firstWorldFrames >= 8));

0 commit comments

Comments
 (0)