Skip to content

Commit 7bee6b3

Browse files
authored
Merge pull request #215 from SkyBlade1978/master-1.21.11
Master 1.21.11
2 parents 64b477d + 9935532 commit 7bee6b3

52 files changed

Lines changed: 2819 additions & 1396 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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
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+
* Honour exact biome-to-geome weights on dynamic biome registries.
7+
* Stagger close Stable Layers geome transitions by layer instead of changing a whole rock column at one boundary.
8+
* Recalibrate Stable Layers edge-detail presets so Average retains natural variation at later rock contacts.
9+
* Existing chunks are not rewritten; the correction applies while generating new chunks.
10+
11+
Version 4.0.5
12+
13+
* Complete native translations for every shipped non-English locale
14+
* Add automatic fresh-and-reload validation for provider-owned custom biomes
15+
* Correct Minecraft 1.21.11 Identifier documentation and ForgeGradle workflow
16+
* Preserve public API major 1 and provider/global/world schemas 4/6/5
17+
118
Version 3.3.1
219

320
* Fix several bugs

‎README.md‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MMD OreSpawn
22

3-
OreSpawn 4 is a provider-driven world-generation engine for Minecraft 1.21.1.
3+
OreSpawn 4 is a provider-driven world-generation engine for Minecraft 1.21.11.
44
It gives mods and modpacks one place to configure ores, deposit shapes, optional
55
rock strata and geomes, provider-owned underground fluid deposits, biome
66
palettes and world materials, flat bedrock, and bounded ore retrogen.
@@ -42,6 +42,9 @@ Important files:
4242

4343
Profile edits affect newly generated chunks. Ore and flat-bedrock retrogen are
4444
separate opt-in features; OreSpawn never retro-generates rock strata.
45+
Stable Layers honours exact biome-ID geome influences on dynamic biome
46+
registries and spreads close geome transitions across layers rather than
47+
changing an entire vertical rock column at one boundary.
4548

4649
To move a configured single-player world to a dedicated server, copy the
4750
world's `serverconfig/orespawn-worldgen.json` with the world and install the
@@ -79,10 +82,21 @@ exported to `config/orespawn-guide/` without overwriting existing files.
7982
Use Java 21 from the repository root:
8083

8184
```powershell
82-
.\gradlew.bat test processResources build javadoc --no-daemon
83-
.\gradlew.bat genEclipseRuns eclipse --no-daemon
85+
.\gradlew.bat clean build javadoc --no-daemon
86+
.\gradlew.bat genEclipseRuns --no-daemon
8487
```
8588

89+
`build` runs the standard `check` lifecycle. In addition to the JUnit suite,
90+
that lifecycle packages a test-only provider mod and verifies exposed,
91+
underwater, filler, and ceiling surfaces in open and ceiling normal-noise
92+
dimensions. It also proves later vegetation, structures, and block entities
93+
survive, verifies identifier-weighted geology in a dynamic custom biome, then
94+
reopens and checks the exact saved world. The fixture is not included in
95+
OreSpawn's published jars.
96+
97+
Import or refresh the project with Eclipse Buildship. ForgeGradle 7's legacy
98+
`eclipse` task produces Java-only metadata and must not be used for this branch.
99+
86100
Machine-specific `AGENTS.md` and `agent-notes/` files are intentionally ignored.
87101
Public developer and AI integration guidance lives in `docs/` and is included
88102
in the built jar.

‎build.gradle‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ minecraft {
8888
applyBenchmarkProperties(delegate, '4', '3', '256')
8989
}
9090

91+
['Fresh', 'Reload'].each { String phase ->
92+
register("surfaceIntegration${phase}") {
93+
mainClass = 'net.minecraftforge.bootstrap.ForgeBootstrap'
94+
args '--launchTarget', 'forge_userdev_server_gametest', '--gameDir', '.'
95+
environment 'MCP_MAPPINGS', "official_${minecraft_version}"
96+
workingDir = layout.buildDirectory.dir('surface-integration-run')
97+
systemProperty 'forge.enableGameTest', 'true'
98+
systemProperty 'forge.enabledGameTestNamespaces', 'surfaceprobe'
99+
systemProperty 'forge.logging.console.level', 'info'
100+
systemProperty 'surfaceprobe.integrationPhase', phase.toLowerCase(Locale.ROOT)
101+
mods {
102+
create(mod_id) {
103+
source sourceSets.main
104+
}
105+
}
106+
}
107+
}
108+
91109
register('data') {
92110
workingDir = layout.projectDirectory.dir('run-data')
93111
args '--mod', mod_id, '--all',
@@ -207,6 +225,74 @@ tasks.named('test', Test).configure {
207225
useJUnitPlatform()
208226
}
209227

228+
def surfaceIntegrationClasses = layout.buildDirectory.dir('surface-integration-fixture/classes')
229+
def compileSurfaceIntegrationTestMod = tasks.register('compileSurfaceIntegrationTestMod', JavaCompile) {
230+
dependsOn tasks.named('classes')
231+
source fileTree('src/biomeIntegrationTest/java')
232+
classpath = files(sourceSets.main.output, sourceSets.main.compileClasspath)
233+
destinationDirectory.set(surfaceIntegrationClasses)
234+
javaCompiler.set(javaToolchains.compilerFor {
235+
languageVersion = JavaLanguageVersion.of(21)
236+
})
237+
options.release = 21
238+
options.encoding = 'UTF-8'
239+
}
240+
241+
def surfaceIntegrationTestModJar = tasks.register('surfaceIntegrationTestModJar', Jar) {
242+
dependsOn compileSurfaceIntegrationTestMod
243+
archiveFileName = 'surfaceprobe.jar'
244+
destinationDirectory = layout.buildDirectory.dir('surface-integration-fixture')
245+
manifest {
246+
attributes 'MixinConfigs': 'surfaceprobe.mixins.json'
247+
}
248+
from surfaceIntegrationClasses
249+
from 'src/biomeIntegrationTest/resources'
250+
}
251+
252+
def surfaceIntegrationRunDirectory = layout.buildDirectory.dir('surface-integration-run')
253+
def prepareSurfaceIntegrationTest = tasks.register('prepareSurfaceIntegrationTest') {
254+
dependsOn surfaceIntegrationTestModJar
255+
doLast {
256+
delete surfaceIntegrationRunDirectory
257+
copy {
258+
from surfaceIntegrationTestModJar.flatMap { it.archiveFile }
259+
into surfaceIntegrationRunDirectory.map { it.dir('mods') }
260+
}
261+
}
262+
}
263+
264+
tasks.configureEach {
265+
if (name == 'runSurfaceIntegrationFresh') {
266+
dependsOn prepareSurfaceIntegrationTest
267+
} else if (name == 'runSurfaceIntegrationReload') {
268+
dependsOn 'runSurfaceIntegrationFresh'
269+
}
270+
}
271+
272+
def surfaceIntegrationTest = tasks.register('surfaceIntegrationTest') {
273+
group = 'verification'
274+
description = 'Verifies provider surfaces and dynamic-biome geology across fresh and reloaded normal terrain.'
275+
dependsOn 'runSurfaceIntegrationReload'
276+
doLast {
277+
File marker = surfaceIntegrationRunDirectory.get().file(
278+
'gametestserver/gametestworld/surfaceprobe-integration.properties').asFile
279+
if (!marker.isFile()) {
280+
throw new GradleException("Surface integration completion marker is missing: ${marker}")
281+
}
282+
Properties result = new Properties()
283+
marker.withInputStream { result.load(it) }
284+
if (result.getProperty('reload_verified') != 'true') {
285+
throw new GradleException("Surface integration reload was not verified: ${marker}")
286+
}
287+
logger.lifecycle('Provider surfaces and dynamic-biome geology verified: {} dimensions, {} columns each, fresh + reload',
288+
result.getProperty('dimensions'), result.getProperty('columns_per_dimension'))
289+
}
290+
}
291+
292+
tasks.named('check') {
293+
dependsOn surfaceIntegrationTest
294+
}
295+
210296
// ForgeGradle 7 generates a launch for every source set, but its ordinary
211297
// Eclipse launches currently omit JDT's test-code exclusion. Without this,
212298
// Eclipse adds build/sourceSets/test to the Java module path and Java rejects

‎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/API.md‎

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Submit declarations during `InterModEnqueueEvent`:
2121

2222
```java
2323
WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
24-
.rock(new ResourceLocation("examplemod", "slate"), GeologyFamily.METAMORPHIC, rock -> rock
24+
.rock(Identifier.parse("examplemod:slate"), GeologyFamily.METAMORPHIC, rock -> rock
2525
.depth(12, 36)
2626
.weight(1.2)
2727
.oreReplaceable(true))
@@ -33,7 +33,7 @@ For a complete ore-only Java example, including dimensions, height curves,
3333
patterns, and host tags, see `DEVELOPER_GUIDE.md`.
3434

3535
Definitions are immutable after `build()`. Registry references remain
36-
`ResourceLocation` values until OreSpawn validates and bakes them. Provider
36+
`Identifier` values until OreSpawn validates and bakes them. Provider
3737
messages are processed through Forge IMC and frozen at load completion; direct
3838
cross-mod mutation during parallel setup is unsupported.
3939

@@ -56,17 +56,17 @@ FormationDefinition formations = FormationDefinition.builder()
5656
.waviness(FormationPreset.LARGE)
5757
.build();
5858
FluidDepositDefinition brine = FluidDepositDefinition.builder(
59-
new ResourceLocation("examplemod", "fluid_deposit/brine"),
60-
new ResourceLocation("examplemod", "brine"))
61-
.dimension(new ResourceLocation("minecraft", "overworld"), placement -> placement
59+
Identifier.parse("examplemod:fluid_deposit/brine"),
60+
Identifier.parse("examplemod:brine"))
61+
.dimension(Identifier.parse("minecraft:overworld"), placement -> placement
6262
.yRange(-48, 32)
6363
.attempts(0.05)
6464
.radius(4, 10)
6565
.verticalRadius(2, 4)
6666
.maxLobes(3)
6767
.minSolidCover(2)
6868
.minSolidShell(1)
69-
.hostTag(new ResourceLocation("minecraft", "stone_ore_replaceables")))
69+
.hostTag(Identifier.parse("minecraft:stone_ore_replaceables")))
7070
.build();
7171

7272
WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
@@ -83,29 +83,29 @@ provides a small optional convenience for cloning a known biome:
8383
```java
8484
RegistryObject<Biome> candyPlains = OreSpawnBiomes.copyAndRegister(
8585
BIOMES, "candy_plains",
86-
() -> ForgeRegistries.BIOMES.getValue(new ResourceLocation("minecraft", "plains")),
86+
() -> ForgeRegistries.BIOMES.getValue(Identifier.parse("minecraft:plains")),
8787
builder -> builder.temperature(0.8F).downfall(0.4F));
8888
```
8989

9090
Then declare placement and materials through the same provider:
9191

9292
```java
9393
WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
94-
.biomePalette(new ResourceLocation("examplemod", "overworld"),
95-
new ResourceLocation("minecraft", "overworld"), palette -> palette
94+
.biomePalette(Identifier.parse("examplemod:overworld"),
95+
Identifier.parse("minecraft:overworld"), palette -> palette
9696
.mode(BiomePlacementMode.REPLACE)
9797
.scope(BiomeReplacementScope.MINECRAFT_ONLY)
9898
.regionSize(BiomeRegionSize.LARGE)
9999
.coverage(1.0)
100100
.fallbackWeight(0.0)
101-
.biome(new ResourceLocation("examplemod", "candy_plains"), biome -> biome
101+
.biome(Identifier.parse("examplemod:candy_plains"), biome -> biome
102102
.weight(3.0)
103-
.similarBiome(new ResourceLocation("minecraft", "plains"))))
104-
.dimensionMaterials(new ResourceLocation("examplemod", "overworld_materials"),
105-
new ResourceLocation("minecraft", "overworld"), materials -> materials
106-
.defaultFluid(new ResourceLocation("examplemod", "lemonade"))
107-
.snowBlock(new ResourceLocation("examplemod", "icing"))
108-
.iceBlock(new ResourceLocation("examplemod", "frozen_lemonade")))
103+
.similarBiome(Identifier.parse("minecraft:plains"))))
104+
.dimensionMaterials(Identifier.parse("examplemod:overworld_materials"),
105+
Identifier.parse("minecraft:overworld"), materials -> materials
106+
.defaultFluid(Identifier.parse("examplemod:lemonade"))
107+
.snowBlock(Identifier.parse("examplemod:icing"))
108+
.iceBlock(Identifier.parse("examplemod:frozen_lemonade")))
109109
.build();
110110
```
111111

@@ -125,9 +125,11 @@ OreSpawnApi.createSampler(server.overworld()).ifPresent(sampler -> {
125125
});
126126
```
127127

128-
`sampleColumn` performs one biome/geome classification and reuses it for every
129-
Y query. Sampling is read-only and is intended for gameplay decisions,
130-
diagnostics, and compatible generation outside OreSpawn's block loops.
128+
`sampleColumn` performs one biome/dominant-geome classification and reuses its
129+
transition scores for every Y query. `rockAt` therefore matches Stable Layers
130+
when a close geome transition is staggered by layer. Sampling is read-only and
131+
is intended for gameplay decisions, diagnostics, and compatible generation
132+
outside OreSpawn's block loops.
131133
Callbacks inside OreSpawn generation loops are intentionally unsupported.
132134

133135
Custom pattern mods create a Forge `DeferredRegister<OrePatternType>` using

‎docs/BIOMES.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ applying small changes. This is useful for a simple content mod:
9999
```java
100100
RegistryObject<Biome> candyPlains = OreSpawnBiomes.copyAndRegister(
101101
BIOMES, "candy_plains",
102-
() -> ForgeRegistries.BIOMES.getValue(new ResourceLocation("minecraft", "plains")),
102+
() -> ForgeRegistries.BIOMES.getValue(Identifier.parse("minecraft:plains")),
103103
builder -> builder.temperature(0.8F).downfall(0.4F));
104104
```
105105

@@ -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

0 commit comments

Comments
 (0)