Skip to content

Commit 43351ec

Browse files
authored
Update OreSpawn for Minecraft 1.10.2
Add geology and admin tools, and keep saved ore settings and completed retrogen.
1 parent d161497 commit 43351ec

89 files changed

Lines changed: 7182 additions & 386 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.110021.jar
130-
build/libs/OreSpawn-4.1.6.110021-sources.jar
131-
build/libs/OreSpawn-4.1.6.110021-javadoc.jar
129+
build/libs/OreSpawn-4.1.7.110021.jar
130+
build/libs/OreSpawn-4.1.7.110021-sources.jar
131+
build/libs/OreSpawn-4.1.7.110021-javadoc.jar
132132
build/release/SHA256SUMS
133133
CHANGELOG.txt
134134

‎CHANGELOG.txt‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
Version 4.1.7.110021
2+
3+
* Keep completed retrogen marked through later saves and restarts, even while
4+
retrogen is off. Do not mark chunks with a revision they have not processed.
5+
6+
* Add loaded-chunk ore surveys, JSON/CSV reports, chunk details and rule
7+
explanations. Keep read-only diagnostics independent of generation settings.
8+
* Restore terrain clearing with permission checks, a preview, a verified
9+
backup and checked undo. Keep ores, fluid deposits and unknown blocks safe.
10+
Show short previews with clickable confirmation, cancellation and undo links.
11+
12+
* Keep saved ore settings when a provider renames a recognised rule. Add the
13+
matching modern rule as a disabled alternative rather than another ore pass.
14+
15+
* Add provider/profile declarations and compiled natural rock formations.
16+
Use the same deterministic, chunk-local geometry for early terrain placement
17+
and geology prediction, with read-only formation and parent-material queries.
18+
* Preserve caves, fluids, structures, other ores and existing chunks. Existing
19+
worlds without formation definitions keep that absence in later terrain too.
20+
* Let realism templates tune untouched packaged formations while preserving
21+
authored, disabled, removed and authoritative external definitions.
22+
* Keep native granite/diorite/andesite patches from cutting the expanded
23+
formation rocks differently according to chunk population order, without
24+
changing normal metal-ore hosts or older profiles.
25+
* Preserve natural formation rock in vanilla lava-lake rims regardless of
26+
neighbouring chunk order. Keep native lake shapes, fluid cavities and random
27+
draws unchanged in normal, Amplified, Large Biomes and Customized worlds;
28+
leave older profiles and custom generators alone.
29+
130
Version 4.1.6.110021
231

332
* Fix duplicate ore generation when an OreSpawn 1 world is moved without its

‎README.md‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ 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.110021`: the OreSpawn 4.1.6
13+
This branch builds local candidate `4.1.7.110021`: the OreSpawn 4.1.7
1414
feature set for Minecraft 1.10.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 and
1717
a biome directory with exact new-terrain replacement overrides, plus a client
18-
world-settings extension point for add-ons such as Realistic Deposits
19-
while retaining API major 1. See the
18+
world-settings extension point for add-ons such as Realistic Deposits.
19+
Natural rock formations now share their compiled geometry between early
20+
terrain placement and read-only geology prediction, including formation and
21+
parent-material provenance. Missing formation sections in saved worlds remain
22+
empty; this is not retrogen or a wholesale 4.2 backport. API major 1 is retained.
23+
See the
2024
[versioning policy](docs/VERSIONS.md) for the encoding and release convention.
2125

2226
Its deprecated compatibility layer imports OreSpawn 1 and OreSpawn 3
@@ -27,6 +31,10 @@ metadata block states, exclusive legacy height ceilings, and the historical
2731
Metals. OreSpawn never schedules both an original legacy generator and its OS4
2832
translation.
2933

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+
3038
This is not the unrelated mod that adds mobs and dimensions under the same
3139
name.
3240

@@ -208,3 +216,10 @@ Public developer and AI integration guidance lives in `docs/` and is included
208216
in the built jar.
209217

210218
OreSpawn is licensed under LGPL-2.1.
219+
220+
## Admin and distribution tools
221+
222+
Use `/orespawn help` for loaded-chunk surveys, rule explanations and chunk
223+
diagnostics. Guarded `/orespawn clearchunk` previews one chunk before changing
224+
it and keeps a verified backup for checked undo. Open chat to review the preview
225+
and choose Confirm clearing or Cancel. See [the admin guide](docs/ADMIN_TOOLS.md).

‎build.gradle‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ tasks.withType(JavaCompile).configureEach {
5959
sourceCompatibility = JavaVersion.VERSION_1_8
6060
targetCompatibility = JavaVersion.VERSION_1_8
6161
options.encoding = 'UTF-8'
62+
// javac 8 can emit different anonymous-class constant pools after a partial
63+
// incremental compile. Compile the complete source set for stable jar bytes.
64+
options.incremental = false
6265
options.compilerArgs.addAll(['-Xmaxerrs', '1000'])
6366
}
6467

@@ -189,8 +192,8 @@ tasks.register('verifyDocumentationParity') {
189192
dependsOn tasks.named('processResources')
190193
doLast {
191194
List<File> tracked = trackedDocumentationFiles()
192-
if (tracked.size() != 20) {
193-
throw new GradleException("Expected 20 tracked documentation files, found ${tracked.size()}")
195+
if (tracked.size() != 22) {
196+
throw new GradleException("Expected 22 tracked documentation files, found ${tracked.size()}")
194197
}
195198
tracked.each { File source ->
196199
String relative = documentationRelativePath(source)

‎docs/ADMIN_TOOLS.md‎

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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
96+
snapshot requires a new preview. There is no immediate, unconfirmed clear mode.
97+
98+
Clearing removes recognised native/provider host rocks and background fluids.
99+
Known ore outputs, configured fluid deposits, bedrock, tile entities and
100+
unrecognised blocks are protected. Protection wins if a state is both an ore
101+
and a host. When a configured deposit uses ordinary water or lava, the same
102+
fluid elsewhere is protected too: there is no reliable historical provenance.
103+
104+
Before the first write, the tool writes, flushes and verifies an immutable
105+
checksummed journal under `orespawn/diagnostics/backups/<backup-id>/`.
106+
If that fails, no clearing occurs. Backups are not automatically deleted.
107+
They remain on disk after restarts; `jobs backups` gives their directory.
108+
Journals record the Minecraft version and are not interchangeable with backups
109+
from other Minecraft versions, whose height and block-state encodings differ.
110+
111+
Undo validates every recorded state and checks the current blocks before
112+
restoring anything. Already-restored cells are harmless; other intervening
113+
edits cause a conflict rather than being overwritten. Work can be cancelled
114+
or interrupted, so always inspect its final job status. A partial edit remains
115+
recoverable from its original journal and never resumes by itself after restart.
116+
Cancellation stops block writes, then finishes bounded lighting cleanup. If
117+
the chunk or its lighting area unloads, the report records the interruption
118+
and the chunk is marked for native relighting instead of claiming completion.
119+
120+
Undo restores recorded block states, not entity movement, elapsed time, mining
121+
or changes made elsewhere. Fluids from outside the selection can later flow
122+
back in. It is not a substitute for a full world backup.
123+
124+
One server job runs at a time, yielding after 16,384 block visits or a 4 ms
125+
cooperative budget. File output runs separately and touches no live world.
126+
No command expands the loaded chunk set to finish a report or an edit.
127+
Reports stop with an explicit error above 500,000 count-table rows; individual
128+
sidecars are limited to 32 MiB. Reduce the area or height range if you hit a
129+
limit. Existing backups are never removed to make room.
130+
The file-worker backlog is capped at 32 tasks. A full queue reports failure;
131+
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 1 And OreSpawn 3 Compatibility On Minecraft 1.10.2
440

541
This branch ships deprecated compatibility bridges for existing OreSpawn 1 and

‎docs/PLAYER_GUIDE.md‎

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

183+
For measured ore counts, chunk details and guarded terrain clearing, see
184+
[Admin tools](ADMIN_TOOLS.md). Surveys read loaded chunks only; clearing and
185+
undo need explicit permission, a preview and a verified backup.
186+
183187
The server console commands `/orespawn status`, `/orespawn reload`, and
184188
`/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
@@ -14,6 +14,8 @@ API and provider references for the details.
1414
- [Configuration field reference](CONFIGURATION.md)
1515
- [Provider JSON files](PROVIDERS.md)
1616
- [Java API and custom patterns](API.md)
17+
- [Natural rock formations](ROCK_FORMATIONS.md)
18+
- [Admin commands, ore surveys and guarded clearing](ADMIN_TOOLS.md)
1719
- [Ore patterns and runtime tools](FEATURES.md)
1820
- [Templates](TEMPLATES.md)
1921
- [Biomes and world materials](BIOMES.md)

0 commit comments

Comments
 (0)