Skip to content

Commit d9d3fa8

Browse files
authored
Merge pull request #217 from SkyBlade1978/master-1.19
Master 1.19
2 parents 30a3aa8 + 44235de commit d9d3fa8

50 files changed

Lines changed: 2788 additions & 1372 deletions

Some content is hidden

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

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* text=auto
1+
# Store and check out repository text as LF on every platform. Windows command
2+
# files are the sole exception below.
3+
* text=auto eol=lf
24

35
*.bat text eol=crlf
46
#*.bat text eol=lf

CHANGELOG.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Version 4.0.6
2+
3+
* Fix provider top and filler materials being generated one block below exposed ground.
4+
* Apply underwater materials from the corrected ground and ceiling materials to roof undersides.
5+
* Preserve trees, vegetation, structures and block entities by running surface replacement before late features.
6+
* Existing chunks are not rewritten; the correction applies while generating new chunks.
7+
8+
Version 4.0.5
9+
10+
* Complete native translations for every shipped non-English locale
11+
* Add automatic fresh-and-reload validation for provider-owned custom biomes
12+
* Verify both public biome-registration helpers on Forge 45
13+
* Confirm Minecraft 1.19.4 ResourceLocation documentation and ForgeGradle workflow
14+
* Preserve public API major 1 and provider/global/world schemas 4/6/5
15+
116
Version 3.3.1
217

318
* Fix several bugs

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,20 @@ exported to `config/orespawn-guide/` without overwriting existing files.
7979
Use Java 17 from the repository root:
8080

8181
```powershell
82-
.\gradlew.bat test processResources build javadoc --no-daemon
82+
.\gradlew.bat clean build javadoc --no-daemon
8383
.\gradlew.bat genEclipseRuns eclipse --no-daemon
8484
```
8585

86+
`build` runs the standard `check` lifecycle. In addition to the JUnit suite,
87+
that lifecycle packages a test-only provider mod and verifies exposed,
88+
underwater, filler, and ceiling surfaces in open and ceiling normal-noise
89+
dimensions. It also proves later vegetation, structures, and block entities
90+
survive, then reopens and checks the exact saved world. The fixture is not
91+
included in OreSpawn's published jars.
92+
93+
Run both `genEclipseRuns` and `eclipse` after importing or refreshing this
94+
ForgeGradle 6 project in Eclipse.
95+
8696
Machine-specific `AGENTS.md` and `agent-notes/` files are intentionally ignored.
8797
Public developer and AI integration guidance lives in `docs/` and is included
8898
in the built jar.

build.gradle

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ minecraft {
186186
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
187187
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
188188
}
189+
190+
['Fresh', 'Reload'].each { String phase ->
191+
create("surfaceIntegration${phase}") {
192+
parent runs.server
193+
workingDirectory layout.buildDirectory.dir('surface-integration-run').get().asFile
194+
property 'forge.logging.console.level', 'info'
195+
property 'surfaceprobe.integrationPhase', phase.toLowerCase(Locale.ROOT)
196+
args '--nogui'
197+
}
198+
}
189199
}
190200
}
191201

@@ -291,6 +301,84 @@ tasks.named('test', Test).configure {
291301
useJUnitPlatform()
292302
}
293303

304+
def surfaceIntegrationClasses = layout.buildDirectory.dir('surface-integration-fixture/classes')
305+
def compileSurfaceIntegrationTestMod = tasks.register('compileSurfaceIntegrationTestMod', JavaCompile) {
306+
dependsOn tasks.named('classes')
307+
source fileTree('src/biomeIntegrationTest/java')
308+
classpath = files(sourceSets.main.output, sourceSets.main.compileClasspath)
309+
destinationDirectory.set(surfaceIntegrationClasses)
310+
javaCompiler.set(javaToolchains.compilerFor {
311+
languageVersion = JavaLanguageVersion.of(17)
312+
})
313+
options.release = 17
314+
options.encoding = 'UTF-8'
315+
}
316+
317+
def surfaceIntegrationTestModJar = tasks.register('surfaceIntegrationTestModJar', Jar) {
318+
dependsOn compileSurfaceIntegrationTestMod
319+
archiveFileName = 'surfaceprobe.jar'
320+
destinationDirectory = layout.buildDirectory.dir('surface-integration-fixture')
321+
from surfaceIntegrationClasses
322+
from 'src/biomeIntegrationTest/resources'
323+
}
324+
325+
def surfaceIntegrationRunDirectory = layout.buildDirectory.dir('surface-integration-run')
326+
def prepareSurfaceIntegrationTest = tasks.register('prepareSurfaceIntegrationTest') {
327+
dependsOn surfaceIntegrationTestModJar
328+
doLast {
329+
File runDirectory = surfaceIntegrationRunDirectory.get().asFile
330+
delete runDirectory
331+
runDirectory.mkdirs()
332+
copy {
333+
from surfaceIntegrationTestModJar.flatMap { it.archiveFile }
334+
into surfaceIntegrationRunDirectory.map { it.dir('mods') }
335+
}
336+
new File(runDirectory, 'server.properties').setText('''\
337+
level-name=surface-integration-world
338+
level-seed=0
339+
level-type=minecraft:normal
340+
online-mode=false
341+
allow-nether=true
342+
generate-structures=false
343+
spawn-protection=0
344+
max-tick-time=-1
345+
''', 'UTF-8')
346+
new File(runDirectory, 'eula.txt').setText('eula=true\n', 'UTF-8')
347+
}
348+
}
349+
350+
tasks.configureEach {
351+
if (name == 'runSurfaceIntegrationFresh') {
352+
dependsOn prepareSurfaceIntegrationTest
353+
} else if (name == 'runSurfaceIntegrationReload') {
354+
dependsOn 'runSurfaceIntegrationFresh'
355+
}
356+
}
357+
358+
def surfaceIntegrationTest = tasks.register('surfaceIntegrationTest') {
359+
group = 'verification'
360+
description = 'Verifies provider surfaces and dynamic-biome geology across fresh and reloaded normal terrain.'
361+
dependsOn 'runSurfaceIntegrationReload'
362+
doLast {
363+
File marker = surfaceIntegrationRunDirectory.get().file(
364+
'surface-integration-world/surfaceprobe-integration.properties').asFile
365+
if (!marker.isFile()) {
366+
throw new GradleException("Surface integration completion marker is missing: ${marker}")
367+
}
368+
Properties result = new Properties()
369+
marker.withInputStream { result.load(it) }
370+
if (result.getProperty('reload_verified') != 'true') {
371+
throw new GradleException("Surface integration reload was not verified: ${marker}")
372+
}
373+
logger.lifecycle('Provider surfaces and dynamic-biome geology verified: {} dimensions, {} columns each, fresh + reload',
374+
result.getProperty('dimensions'), result.getProperty('columns_per_dimension'))
375+
}
376+
}
377+
378+
tasks.named('check') {
379+
dependsOn surfaceIntegrationTest
380+
}
381+
294382
// Keep every Eclipse launch input on one physical Gradle cache. Mixing Buildship's
295383
// cache with a command-line cache duplicates named Java modules such as FML and Mixin.
296384
def syncEclipseRunClasspaths = tasks.register('syncEclipseRunClasspaths') {
@@ -463,6 +551,7 @@ def syncEclipseRunClasspaths = tasks.register('syncEclipseRunClasspaths') {
463551
}
464552

465553
int changedLaunches = 0
554+
int changedTestExclusions = 0
466555
if (eclipseLaunchDir.isDirectory()) {
467556
File eclipseClasses = file('bin/main').canonicalFile
468557
String modClasses = "${mod_id}%%${eclipseClasses.absolutePath}"
@@ -480,6 +569,27 @@ def syncEclipseRunClasspaths = tasks.register('syncEclipseRunClasspaths') {
480569
/<mapEntry key="MOD_CLASSES" value="[^"]*"\/>/) {
481570
"<mapEntry key=\"MOD_CLASSES\" value=\"${modClasses}\"/>"
482571
}
572+
String excludeTestKey = 'org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE'
573+
String excludeTestAttribute =
574+
"<booleanAttribute key=\"${excludeTestKey}\" value=\"true\"/>"
575+
String beforeTestExclusion = synced
576+
if (synced.contains("key=\"${excludeTestKey}\"")) {
577+
synced = synced.replaceFirst(
578+
/<booleanAttribute key="org\.eclipse\.jdt\.launching\.ATTR_EXCLUDE_TEST_CODE" value="[^"]*"\/>/,
579+
excludeTestAttribute)
580+
} else {
581+
int launchHeaderEnd = synced.indexOf('\n', synced.indexOf('<launchConfiguration'))
582+
if (launchHeaderEnd < 0) {
583+
throw new GradleException("Malformed Eclipse Java launch configuration: ${launchFile}")
584+
}
585+
String lineSeparator = synced.contains('\r\n') ? '\r\n' : '\n'
586+
synced = "${synced.substring(0, launchHeaderEnd + 1)}" +
587+
" ${excludeTestAttribute}${lineSeparator}" +
588+
synced.substring(launchHeaderEnd + 1)
589+
}
590+
if (beforeTestExclusion != synced) {
591+
changedTestExclusions++
592+
}
483593
if (original != synced) {
484594
launchFile.setText(synced, 'UTF-8')
485595
changedLaunches++
@@ -505,7 +615,7 @@ def syncEclipseRunClasspaths = tasks.register('syncEclipseRunClasspaths') {
505615
changedLaunchGroups++
506616
}
507617
}
508-
logger.lifecycle("Eclipse runtime paths aligned with ${eclipseCache} (${stableClasspaths.size()} Forge classpaths, ${changedProjectClasspath} project classpath, ${changedResourceExclusions} metadata exclusion, ${changedPrepareLaunches} prepare launches, ${changedLaunches} slim launches, ${changedLaunchGroups} direct project launches updated)")
618+
logger.lifecycle("Eclipse runtime paths aligned with ${eclipseCache} (${stableClasspaths.size()} Forge classpaths, ${changedProjectClasspath} project classpath, ${changedResourceExclusions} metadata exclusion, ${changedPrepareLaunches} prepare launches, ${changedLaunches} slim launches, ${changedTestExclusions} test exclusions, ${changedLaunchGroups} direct project launches updated)")
509619
}
510620
}
511621

docs/AGENTS.md

Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,15 @@
1-
# OreSpawn Integration Notes For Coding Agents
1+
# OreSpawn Documentation Map
22

3-
OreSpawn 4.0 is a required Forge mod and declarative world-generation engine.
4-
Public API major version 1 consists only of `zone.moddev.mc.orespawn.api`. Treat
5-
every other Java package as internal and unstable.
3+
This index is for navigating the documentation to learn how to integrate with
4+
and use OreSpawn with a mod or modpack. Start with
5+
[DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md).
66

7-
Integration entry points:
7+
Use the focused guides for implementation details:
88

9-
- Java declarations: `OreSpawnApi.enqueue(WorldgenProvider)` during
10-
`InterModEnqueueEvent`.
11-
- Packaged declarations: `data/<modid>/orespawn/provider.json`.
12-
- Pack overrides: `config/<modid>-orespawn.json`.
13-
- Active queries: `getActiveProfile(MinecraftServer)` and
14-
`createSampler(ServerLevel)`.
15-
- Native-ore takeover: disable only when `isOreTakeoverActive(modid)` is true.
16-
17-
Configuration contracts:
18-
19-
- Global `config/orespawn-worldgen.json`: schema 6.
20-
- World `serverconfig/orespawn-worldgen.json`: schema 5.
21-
- Provider files: schema 4; legacy schemas 1-3 remain accepted.
22-
- Ore placement accepts fixed `quantity` or paired inclusive
23-
`min_quantity`/`max_quantity` values in the range 1-64. A complete range is
24-
authoritative when both forms exist.
25-
- `dimension_selectors.orespawn:all_except_nether_end` applies to ordinary
26-
dimensions but never Nether or End. Explicit dimension entries override it
27-
per ore and must also drive vanilla-feature suppression.
28-
- JSON Schemas and examples are under `META-INF/orespawn/docs/` in the jar.
29-
- Schema 4 providers may declare `biome_palettes` and `dimension_materials`.
30-
Palettes wrap the native dimension biome source. Region presets are 128,
31-
256, 512, 1024, and 2048 blocks.
32-
33-
Lifecycle and ownership:
34-
35-
- Forge setup is parallel. Never mutate OreSpawn internals directly.
36-
- A pack override file is authoritative over packaged and API definitions for
37-
the same provider. A malformed override fails closed.
38-
- Provider rule IDs use the provider namespace. A rule's `block` or weighted
39-
output may reference any installed block.
40-
- Definitions freeze at load completion and change only after restart or an
41-
operator `/orespawn reload`.
42-
- Auto-selected templates apply only to fresh worlds with no explicit
43-
`default_template`. Highest priority wins, then lexical ID. Existing world
44-
profiles never auto-switch.
45-
46-
Performance constraints:
47-
48-
- Do not request callbacks in block-generation loops.
49-
- Registry IDs remain `ResourceLocation` values until setup-time baking.
50-
- Dimension, tag, alias, biome, geome, family, pattern, and block-state
51-
resolution occurs before generation.
52-
- Biome palettes bake holders, climate bounds, namespace filters, weights,
53-
surfaces, and dimension materials. Provider callbacks never run in selection.
54-
- Ore rules support `uniform`, `triangle`, `bottom_triangle`, and
55-
`uniform_bottom_triangle` height distributions plus a 0-1
56-
`discard_chance_on_air_exposure` value for buried deposits.
57-
- The chunk hot path must contain no config reads, registry access, strings,
58-
logging, reflection, or per-block allocation.
59-
- Cache biome filters as registry keys, never `Biome` object identities;
60-
dynamic-registry biome instances are not identity-stable.
61-
- Ore and flat-bedrock retrogen are bounded and marker-based. Terrain strata
62-
are never retrogened.
63-
64-
Compatibility defaults:
65-
66-
- Standalone OreSpawn is passive: no rocks, terrain dimensions, fluid deposits, ore
67-
suppression, retrogen, or flat bedrock are enabled by default.
68-
- The Overworld is the conventional geology target, but a provider must opt it
69-
in. Nether and End terrain remain untouched unless explicitly configured.
70-
- Mineralogy 6 is a provider, not a public-API compatibility facade. Do not use
71-
removed `zone.moddev.mc.mineralogy.api` classes.
72-
73-
Common tasks are documented in `API.md`, `PROVIDERS.md`, `FEATURES.md`,
74-
`TEMPLATES.md`, `BIOMES.md`, and `DIMENSIONS.md`. Start with
75-
`DEVELOPER_GUIDE.md` when the task is broader than one isolated schema or API
76-
question.
9+
- [API.md](API.md) for the supported Java API;
10+
- [PROVIDERS.md](PROVIDERS.md) for packaged and configurable providers;
11+
- [FEATURES.md](FEATURES.md) for rocks, ores, deposits, and geology;
12+
- [BIOMES.md](BIOMES.md) and [DIMENSIONS.md](DIMENSIONS.md) for world integration;
13+
- [TEMPLATES.md](TEMPLATES.md) for selectable world styles;
14+
- [CONFIGURATION.md](CONFIGURATION.md) for configuration behavior;
15+
- [README.md](README.md) for schemas, examples, and the complete documentation index.

docs/BIOMES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ Biome surfaces support:
118118
- `ceiling_block`: optional underside material;
119119
- `filler_depth`: 0-16 blocks.
120120

121+
Provider surfaces run during `LOCAL_MODIFICATIONS`: after Minecraft has built
122+
base surfaces and lakes, but before structures and vegetation. That ordering
123+
lets OreSpawn replace the actual exposed ground while preserving later trees,
124+
plants, authored structures, and block entities. In ceiling dimensions,
125+
`ceiling_block` applies to the roof underside and does not replace the roof top.
126+
127+
Surface correction is generation-only. Installing or updating OreSpawn does
128+
not rewrite already generated chunks; travel into new terrain to see a changed
129+
provider surface definition.
130+
121131
Dimension materials support the ordinary aquifer fluid, a deep aquifer fluid
122132
and threshold, and replacements for vanilla snow and ice. OreSpawn converts
123133
weather products in loaded chunks and around players; it does not replace every

docs/CONFIGURATION.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ When a control is `custom`, its value comes from `formations.custom`:
7575
| `edge_octaves` | 1-8 | Number of boundary-detail scales |
7676
| `continuity` | 0-1 | Proportion of formations retaining global identity |
7777

78+
For Stable Layers, the Edge Detail presets use these
79+
`wavelength / amplitude / octaves` values:
80+
81+
| Preset | Edge detail |
82+
|---|---:|
83+
| Tiny | `48 / 4 / 1` |
84+
| Small | `64 / 12 / 2` |
85+
| Average | `96 / 24 / 3` |
86+
| Large | `128 / 48 / 4` |
87+
| Huge | `192 / 96 / 5` |
88+
89+
Average is calibrated to retain visible variation at later layer contacts.
90+
Custom profiles keep their explicit values; these numbers are only used by the
91+
named presets and as defaults for new Custom settings.
92+
7893
Cyano settings use `cyano.geome_size` (4-32767),
7994
`cyano.rock_layer_noise` (1-32767), and `cyano.rock_layer_thickness` (1-255).
8095
They are ignored by Sky.

docs/DEVELOPER_GUIDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,12 @@ bounded ore or bedrock retrogen is enabled.
197197
and without compatibility mods.
198198
6. Confirm the provider appears in `/orespawn status`.
199199
7. Test a new world; profile edits do not rewrite already generated terrain.
200+
201+
OreSpawn's own standard `check` lifecycle includes a consumer-style surface
202+
integration test. A separate test provider creates independently marked
203+
Grass/Dirt, underwater, filler, and roof columns in open and ceiling
204+
normal-noise dimensions. The gate verifies biome and chunk edges, late tree,
205+
vegetation, structure and chest sentinels, the roof underside, and exact save
206+
reload behavior. Run `gradlew check` (or `gradlew build`, which includes it)
207+
before publishing any change to biome registration, palettes, surfaces,
208+
feature ordering, height handling, or profile persistence.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ mod_name=MMD OreSpawn
4848
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
4949
mod_license=LGPL-2.1
5050
# The mod version. See https://semver.org/
51-
mod_version=4.0.4
51+
mod_version=4.0.6
5252
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
5353
# This should match the base package used for the mod sources.
5454
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

0 commit comments

Comments
 (0)