Skip to content

Commit 445221b

Browse files
authored
Update OreSpawn for Minecraft 1.11.2
Add geology and admin tools, and keep saved ore settings and completed retrogen.
1 parent 90cc9b7 commit 445221b

98 files changed

Lines changed: 8171 additions & 382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

‎CHANGELOG.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
OreSpawn 4.1.7.111021
2+
- Add chunk surveys, rule explanations and guarded clear/undo tools for test worlds.
3+
- Keep clear and undo previews valid when protected leaves finish a normal decay check.
4+
- Add optional geological formations and preserve provider template overrides.
5+
- Keep formations out of native structure areas, including woodland mansions.
6+
- Keep completed retrogen revisions through repeated saves and server restarts.
7+
- Retain saved ore rules without enabling duplicate provider defaults.
8+
19
## 4.1.6.111021
210

311
- Fix duplicate ore generation when an OreSpawn 1 world is moved without its converted provider file. Keep imported rules and saved choices, and back up the profile before removing a duplicate. Leave edited rules for review.

‎README.md‎

Lines changed: 9 additions & 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.6.111021`: the OreSpawn 4.1.6
13+
This branch builds target-qualified version `4.1.7.111021`: the OreSpawn 4.1.6
1414
feature set for Minecraft 1.11.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
@@ -31,6 +31,10 @@ translation.
3131
If you already have an OreSpawn 4 provider override, importing an older config
3232
leaves it in place. The upgrade report tells you which files were kept.
3333

34+
Recognised provider rule renames keep the saved ore settings and add the modern
35+
rule as a disabled, editable alternative, avoiding an extra generation pass.
36+
See [retained provider rules](docs/MIGRATION.md#retained-provider-rules).
37+
3438
This is not the unrelated mod that adds mobs and dimensions under the same
3539
name.
3640

@@ -186,3 +190,7 @@ Public developer and AI integration guidance lives in `docs/` and is included
186190
in the built jar.
187191

188192
OreSpawn is licensed under LGPL-2.1.
193+
194+
## Distribution tools and formations
195+
196+
Use the [admin tools guide](docs/ADMIN_TOOLS.md) for loaded-chunk surveys and guarded clear/undo. The [formation guide](docs/ROCK_FORMATIONS.md) explains optional provider-defined rock formations. Existing worlds do not adopt formations automatically.

‎build.gradle‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ tasks.register('verifyDocumentationParity') {
211211
dependsOn tasks.named('processResources')
212212
doLast {
213213
List<File> tracked = trackedDocumentationFiles()
214-
if (tracked.size() != 20) {
215-
throw new GradleException("Expected 20 tracked documentation files, found ${tracked.size()}")
214+
if (tracked.size() != 22) {
215+
throw new GradleException("Expected 22 tracked documentation files, found ${tracked.size()}")
216216
}
217217
tracked.each { File source ->
218218
String relative = documentationRelativePath(source)
@@ -286,6 +286,7 @@ apply from: 'gradle/verification/support.gradle'
286286
apply from: 'gradle/verification/legacy-and-migration.gradle'
287287
apply from: 'gradle/verification/client-and-benchmark.gradle'
288288
apply from: 'gradle/verification/packaged-forge.gradle'
289+
apply from: 'gradle/verification/admin-tools.gradle'
289290
apply from: 'gradle/release/artifacts.gradle'
290291
apply from: 'gradle/release/publishing.gradle'
291292
apply from: 'gradle/ide/eclipse.gradle'

‎docs/ADMIN_TOOLS.md‎

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Admin and distribution tools
2+
3+
Use these tools in a disposable Creative world while tuning a pack. Surveys
4+
do not generate terrain or enable OreSpawn's vanilla-ore management. Clearing
5+
is different: it changes saved blocks, including matching player-placed rocks.
6+
7+
## Measure what actually generated
8+
9+
```
10+
/orespawn help
11+
/orespawn status verbose
12+
/orespawn chunk
13+
/orespawn chunk -2 3
14+
/orespawn survey 1
15+
/orespawn survey 2 --y 0 48 --block minecraft:redstone_ore
16+
/orespawn survey 0 --center -2 3 --block minecraft:stone@3
17+
/orespawn explain minecraft:redstone_ore 100 20 -40
18+
/orespawn retrogen status
19+
/orespawn jobs
20+
/orespawn jobs <job-id>
21+
/orespawn cancel <job-id>
22+
```
23+
24+
New diagnostic commands require permission level 2. Ordinary `status` remains
25+
available without operator permission. Existing `reload`, `retrogen [radius]`
26+
and `dump-biomes` commands keep their behaviour. `retrogen status` never queues
27+
work, enables retrogen or writes a generation marker. Its completed flag is
28+
session bookkeeping, not a claim about a chunk's complete history.
29+
30+
Chunk coordinates are block coordinates divided by 16, rounding down, including
31+
negative coordinates. Without coordinates, commands use the player's chunk;
32+
the console uses Overworld spawn. Shared options are `--center <chunkX chunkZ>`,
33+
`--dimension <loaded-numeric-or-namespaced-ID>`, `--y <min max>` and the survey
34+
filter `--block <namespace:block[@metadata]>`. Heights are inclusive. Radius
35+
defaults to 1 and is limited to 8: a square of `(2 * radius + 1)` chunks per side.
36+
37+
Only chunks already loaded are visited. The tool records skipped chunks and
38+
chunks that unload during a scan. A partial report is not a complete regional
39+
sample. Scans happen over a recorded interval, not at one atomic world instant.
40+
For a fair comparison, use the same seed, dimensions, coordinates, height range
41+
and coverage, and avoid mining or construction while collecting the sample.
42+
43+
Reports are stored in the world's `orespawn/diagnostics/reports/<job-id>/`.
44+
Long chat summaries end in `...`; the saved reports are not shortened.
45+
Check `jobs <job-id>` for export completion or I/O failure. JSON records block
46+
states and categories, exact Y levels, biome columns, per-chunk counts, coverage
47+
and the active profile fingerprint. CSV files provide the same count tables.
48+
Total sampled volume includes air; non-air volume is reported separately. A
49+
block filter restricts both those denominators to the matching sample.
50+
51+
Known ores come from native identities, configured outputs and exact Ore
52+
Dictionary registrations. Blocks are counted once even if several providers
53+
share them. All observed states are exported, including unclassified blocks.
54+
Configured fluid outputs are listed separately from ores. Reports do not
55+
identify which mod historically placed a block or declare that a distribution
56+
is statistically correct from a small sample.
57+
58+
`explain` uses OreSpawn's actual baked placement budget, host tests and
59+
chunk-centre biome checks. Frequency means expected attempts per chunk, not
60+
guaranteed blocks. Weighted host tests, random geometry, exposure rolls and
61+
private extension checks still affect results. A rock under the cursor today
62+
is not necessarily the host that existed during original generation. Chunk
63+
geology information is labelled as a current base-geology prediction, not
64+
saved formation provenance.
65+
`chunk` also records observed block states down the centre column, every 16
66+
blocks and at the selected range's endpoints. These sparse samples are not a
67+
whole-chunk count; use `survey 0` for that.
68+
69+
## Expose one chunk, with a way back
70+
71+
```
72+
/orespawn clearchunk --center -2 3
73+
/orespawn clearchunk confirm <preview-token>
74+
/orespawn undo <backup-id>
75+
/orespawn undo <backup-id> confirm <undo-preview-token>
76+
/orespawn jobs backups
77+
```
78+
79+
Clearing and undo require permission level 4. Player operators must be Creative
80+
or Spectator; clearing is refused while a Survival/Adventure player occupies
81+
the target chunk. Keep the surrounding lighting area loaded. The aliases
82+
`/clearchunk` and `/clearchunks` are registered only if another mod has not
83+
claimed them. Both mean one chunk, not a region.
84+
85+
The first command only scans and prints a preview; no blocks change yet.
86+
Review the coordinates, height range and removal count, then open chat (T by
87+
default) and click **Confirm clearing**. That click sends the confirmation
88+
command. **Cancel** dismisses the preview without changing blocks; **Details**
89+
opens the job report. Hover over a link to see its exact command. The commands
90+
above also work when typed, and the server console prints a copyable command.
91+
92+
After clearing, the **Undo…** link starts a restoration preview, not an
93+
immediate restore. Review it and click **Confirm undo** to restore the blocks.
94+
Tokens expire after 120 seconds and belong to their operator and snapshot.
95+
A changed profile or block snapshot requires a new preview. The decay-check
96+
flag on protected vanilla leaves is ignored: Minecraft updates it while checking
97+
healthy trees, without changing the blocks being cleared. Removed leaves,
98+
different leaf types and other block edits still invalidate the preview. Reports
99+
and backups keep exact states, including leaves configured as removable terrain.
100+
There is no immediate, unconfirmed clear mode.
101+
102+
Clearing removes recognised native/provider host rocks and background fluids.
103+
Known ore outputs, configured fluid deposits, bedrock, tile entities and
104+
unrecognised blocks are protected. Protection wins if a state is both an ore
105+
and a host. When a configured deposit uses ordinary water or lava, the same
106+
fluid elsewhere is protected too: there is no reliable historical provenance.
107+
108+
Before the first write, the tool writes, flushes and verifies an immutable
109+
checksummed journal under `orespawn/diagnostics/backups/<backup-id>/`.
110+
If that fails, no clearing occurs. Backups are not automatically deleted.
111+
They remain on disk after restarts; `jobs backups` gives their directory.
112+
Journals record the Minecraft version and are not interchangeable with backups
113+
from other Minecraft versions, whose height and block-state encodings differ.
114+
115+
Undo validates every recorded state and checks the current blocks before
116+
restoring anything. Already-restored cells are harmless; other intervening
117+
edits cause a conflict rather than being overwritten. Work can be cancelled
118+
or interrupted, so always inspect its final job status. A partial edit remains
119+
recoverable from its original journal and never resumes by itself after restart.
120+
Cancellation stops block writes, then finishes bounded lighting cleanup. If
121+
the chunk or its lighting area unloads, the report records the interruption
122+
and the chunk is marked for native relighting instead of claiming completion.
123+
124+
Undo restores recorded block states, not entity movement, elapsed time, mining
125+
or changes made elsewhere. Fluids from outside the selection can later flow
126+
back in. It is not a substitute for a full world backup.
127+
128+
One server job runs at a time, yielding after 16,384 block visits or a 4 ms
129+
cooperative budget. File output runs separately and touches no live world.
130+
No command expands the loaded chunk set to finish a report or an edit.
131+
Reports stop with an explicit error above 500,000 count-table rows; individual
132+
sidecars are limited to 32 MiB. Reduce the area or height range if you hit a
133+
limit. Existing backups are never removed to make room.
134+
The file-worker backlog is capped at 32 tasks. A full queue reports failure;
135+
it never runs file output on the server thread or starts an unbacked edit.

‎docs/CONFIGURATION.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,14 @@ or `host_tags` entry. Optional `biome_ids`, `excluded_biome_ids`,
384384
Only ore rules with `retrogen:true` participate. Terrain strata are never
385385
retro-generated.
386386

387+
Completed revisions survive chunk saves and server restarts, including time
388+
spent with retrogen disabled. Changing settings alone does not mark a new
389+
revision as complete. A different revision, `force:true`, or the manual
390+
retrogen command can deliberately run another pass. Keep force off for normal
391+
use. This repair cannot identify or remove extra ores placed by older builds,
392+
or reconstruct completion markers those builds already lost; back up your save
393+
before enabling retrogen.
394+
387395
`flat_bedrock.enabled` and `flat_bedrock.retrogen` are off by default.
388396
`layers` is 1-5 and `dimensions` is an array of full dimension IDs.
389397

‎docs/MIGRATION.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Migration
22

3+
## Retained Provider Rules
4+
5+
An older profile can keep an ore rule after its provider renames that rule.
6+
OreSpawn must not add a second generation pass just because the ID changed.
7+
The merge recognises OreSpawn's imported `orespawn:legacy/<provider>/...`
8+
rules and the following exact Base Metals replacements:
9+
10+
- `basemetals:legacy/<material>_ore` to `basemetals:ore/<material>` for
11+
coldiron, adamantine, starsteel, tin, lead, zinc, silver, mercury, nickel
12+
and platinum.
13+
14+
A match needs one saved rule and one provider candidate with the same single
15+
output, default metadata, and dimension/selector and effective placement-channel
16+
footprint. Conflicting provider ownership, mixed outputs, different deep outputs
17+
and ambiguous matches are not treated as replacements. A generic mod's
18+
`legacy/` name is not enough evidence.
19+
20+
For a recognised match, the missing modern rule is added as a complete,
21+
disabled alternative. The saved rule keeps its rates, hosts, heights, pattern,
22+
enablement and source choices, including disabled and zero-rate settings.
23+
Fresh worlds still use the provider's normal defaults.
24+
25+
You can enable the alternative in the ore settings. Later merges retain that
26+
choice, existing modern rules and recorded deletions. A recorded deletion of
27+
one of the historical Base Metals IDs also leaves its mapped replacement
28+
disabled. Deleted imports without an exact mapping are not guessed from their
29+
names.
30+
31+
This repair does not automatically remove an already-saved historical
32+
Base Metals/modern pair: both may have been selected deliberately. Review
33+
ambiguous or previously affected profiles before changing their choices.
34+
It does not alter generated chunks, public APIs or saved formats.
35+
36+
The existing OS1 import repair still applies when its own provenance and
37+
backup checks are met; this rule-rename check does not replace it.
38+
339
## OreSpawn 3 Compatibility On Minecraft 1.11.2
440

541
This branch ships a deprecated compatibility bridge for existing OreSpawn 3

‎docs/PLAYER_GUIDE.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,9 @@ For a dedicated server, copy the whole world including that file and install
182182
the same mods. Alternatively, place a prepared global profile at
183183
`config/orespawn-worldgen.json` before creating a new server world.
184184

185+
For measured ore counts, chunk details and guarded terrain clearing, see
186+
[Admin tools](ADMIN_TOOLS.md). Surveys read loaded chunks only; clearing and
187+
undo need explicit permission, a preview and a verified backup.
188+
185189
The server console commands `/orespawn status`, `/orespawn reload`, and
186190
`/orespawn dump-biomes` help pack authors diagnose active providers and IDs.

‎docs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Choose the guide that matches what you are doing:
1111
- [Configuration field reference](CONFIGURATION.md)
1212
- [Provider JSON files](PROVIDERS.md)
1313
- [Java API and custom patterns](API.md)
14+
- [Natural rock formations](ROCK_FORMATIONS.md)
15+
- [Admin commands, ore surveys and guarded clearing](ADMIN_TOOLS.md)
1416
- [Ore patterns and runtime tools](FEATURES.md)
1517
- [Templates](TEMPLATES.md)
1618
- [Biomes and world materials](BIOMES.md)

‎docs/ROCK_FORMATIONS.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Natural rock formations
2+
3+
Vanilla granite/diorite/andesite patches are country-rock decoration, not
4+
metal ores. `OreSpawnApi.isNativeStonePatchPass()` is a thread-local read-only
5+
pass query so expanded natural-rock blocks can decline that decoration while
6+
remaining ordinary metal-ore hosts. OreSpawn clears it on each ore event,
7+
at the end of the ore pass and at world reset; nested passes restore their outer
8+
context. Height caches hold only weak world references. Old profiles without formations
9+
never activate it. Early placement also accepts plain/natural vanilla stone
10+
variants spilled in from a neighbour, but not polished stone, infested blocks,
11+
ore, structures, fluids or tile entities. This makes the formation substrate
12+
independent of whether that native patch ran before or after its chunk.
13+
14+
Provider schema 6 adds `rock_formations`. Older provider schemas and the ordinary
15+
`rocks` layer catalogue keep their existing behavior. A formation is a natural
16+
substrate body, not an ore promise. Every declaration captures an explicit
17+
`algorithm_revision`, enabled state, priority, deterministic salt, geometry and
18+
resolved output materials. Definitions are copied into a new world's profile.
19+
20+
Existing profiles with no section stay without formations, including later
21+
chunks. An existing unprofiled world also starts without them. There is no
22+
formation retrogen. Explicit pack/world entries win over provider defaults.
23+
`Original Strata` retains Mineralogy's modest defaults rather than applying the
24+
Realistic Deposits tuning. Disabling physical terrain or choosing Cyano suppresses
25+
the formation pass. The exact vanilla Overworld generator supports normal,
26+
Amplified, Large Biomes and Customized worlds, with the same lava-lake
27+
protection in each. Custom generators, including subclasses of the vanilla
28+
generator, fail closed for prediction, placement and native patch protection.
29+
30+
Built-in compilers: `orespawn:alkaline_complex`, `granitic_contact`,
31+
`ultramafic_alteration`, `barren_pipe`, `quartz_vein`, `weathering_profile`.
32+
The built-in algorithm revision is 1. All default rules are Overworld-only.
33+
Bodies stay within their deterministic region; coordinates use floor division,
34+
including negative regions. Weathering evaluates warm, wet climate and the
35+
parent below the profile. It does not turn any clay into a bauxite setting.
36+
37+
`WorldgenProvider.Builder.rockFormation(id, type, definition)` declares a body.
38+
`RockFormationRegistry.register(type, compiler)` registers an immutable compiler
39+
during initialization. Compilation resolves blocks, families and settings once;
40+
the registry freezes on first compilation. A prepared column returns either a
41+
baked `FormationMaterial` or null for unchanged country rock. No world mutation
42+
belongs in a compiler. A compiler must be deterministic and must not obtain
43+
chunks, resolve registries or read configuration while sampling.
44+
45+
The early terrain pass and `GeologyColumn.rockAt`/`familyAt` share that prepared
46+
evaluator. `formationAt(y)` is an additive, read-only query exposing the winning
47+
formation ID, algorithm revision, immediate parent state and material. An empty
48+
family is intentional for vein fill and regolith, not a random layer family.
49+
The query describes planned natural substrate: caves, fluids, structures, ores
50+
and subsequent decorations can leave protected gaps in the realised body.
51+
52+
Placement only exchanges the exact predicted original country rock in the
53+
current chunk, before OreSpawn ores. It preserves tile entities, structure
54+
bounding boxes, caves, fluids and other ores. No compensation fills protected
55+
gaps. Reload requires a restart for formation geometry or policy changes.
56+
57+
This contract is local and unreleased. Add-ons must use checksum-bound local
58+
candidate dependencies until an engine release is separately authorised.

0 commit comments

Comments
 (0)