Skip to content

Commit 723e83b

Browse files
authored
Merge pull request #212 from SkyBlade1978/master-1.21.1-neo
Master 1.21.1 neo
2 parents dbe4648 + edff73a commit 723e83b

30 files changed

Lines changed: 2151 additions & 1615 deletions

File tree

.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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 4.0.5
2+
3+
* Complete native translations for every shipped non-English locale
4+
* Add automatic fresh-and-reload validation for provider-owned custom biomes
5+
* Correct NeoForge biome terminology while retaining the Minecraft 1.21.1 ResourceLocation API
6+
* Preserve public API major 1 and provider/global/world schemas 4/6/5
7+
18
Version 3.3.1
29

310
* Fix several bugs

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,19 @@ exported to `config/orespawn-guide/` without overwriting existing files.
7979
Use Java 21 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 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, loads its custom biome in
88+
normal noise terrain, and verifies both fresh generation and reopening the
89+
same saved world. The fixture is not included in OreSpawn's published jars.
90+
91+
Import or refresh the project with Eclipse Buildship. NeoGradle supplies the
92+
Eclipse model and run configurations through the `eclipse` task; this branch
93+
does not use ForgeGradle's `genEclipseRuns` task.
94+
8695
Machine-specific `AGENTS.md` and `agent-notes/` files are intentionally ignored.
8796
Public developer and AI integration guidance lives in `docs/` and is included
8897
in the built jar.

build.gradle

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ runs {
9898
file('src/generated/resources/').absolutePath, '--existing',
9999
file('src/main/resources/').absolutePath
100100
}
101+
102+
['Fresh', 'Reload'].each { String phase ->
103+
register("biomeIntegration${phase}") {
104+
runType 'server'
105+
workingDirectory layout.buildDirectory.dir('biome-integration-run')
106+
systemProperty 'forge.logging.console.level', 'info'
107+
systemProperty 'cakeworld.biomeIntegrationPhase', phase.toLowerCase(Locale.ROOT)
108+
argument '--nogui'
109+
modSource project.sourceSets.main
110+
}
111+
}
101112
}
102113

103114
configurations {
@@ -189,6 +200,88 @@ tasks.named('test', Test).configure {
189200
useJUnitPlatform()
190201
}
191202

203+
def biomeIntegrationClasses = layout.buildDirectory.dir('biome-integration-fixture/classes')
204+
def compileBiomeIntegrationTestMod = tasks.register('compileBiomeIntegrationTestMod', JavaCompile) {
205+
dependsOn tasks.named('classes')
206+
source fileTree('src/biomeIntegrationTest/java')
207+
classpath = files(sourceSets.main.output, sourceSets.main.compileClasspath)
208+
destinationDirectory.set(biomeIntegrationClasses)
209+
javaCompiler.set(javaToolchains.compilerFor {
210+
languageVersion = JavaLanguageVersion.of(21)
211+
})
212+
options.release = 21
213+
options.encoding = 'UTF-8'
214+
}
215+
216+
def biomeIntegrationTestModJar = tasks.register('biomeIntegrationTestModJar', Jar) {
217+
dependsOn compileBiomeIntegrationTestMod
218+
archiveFileName = 'cakeworldprobe.jar'
219+
destinationDirectory = layout.buildDirectory.dir('biome-integration-fixture')
220+
from biomeIntegrationClasses
221+
from 'src/biomeIntegrationTest/resources'
222+
}
223+
224+
def biomeIntegrationRunDirectory = layout.buildDirectory.dir('biome-integration-run')
225+
def prepareBiomeIntegrationTest = tasks.register('prepareBiomeIntegrationTest') {
226+
dependsOn biomeIntegrationTestModJar
227+
doLast {
228+
File runDirectory = biomeIntegrationRunDirectory.get().asFile
229+
delete runDirectory
230+
runDirectory.mkdirs()
231+
copy {
232+
from biomeIntegrationTestModJar.flatMap { it.archiveFile }
233+
into biomeIntegrationRunDirectory.map { it.dir('mods') }
234+
}
235+
new File(runDirectory, 'server.properties').setText('''\
236+
level-name=biome-integration-world
237+
level-seed=-4965128775892001975
238+
level-type=minecraft:normal
239+
online-mode=false
240+
allow-nether=true
241+
generate-structures=false
242+
spawn-protection=0
243+
max-tick-time=-1
244+
''', 'UTF-8')
245+
}
246+
}
247+
248+
tasks.configureEach {
249+
if (name == 'runBiomeIntegrationFresh') {
250+
dependsOn prepareBiomeIntegrationTest
251+
} else if (name == 'runBiomeIntegrationReload') {
252+
dependsOn 'runBiomeIntegrationFresh'
253+
}
254+
}
255+
256+
def biomeIntegrationTest = tasks.register('biomeIntegrationTest') {
257+
group = 'verification'
258+
description = 'Verifies a provider-owned custom biome in fresh and reloaded normal terrain.'
259+
dependsOn 'runBiomeIntegrationReload'
260+
doLast {
261+
File marker = biomeIntegrationRunDirectory.get().file(
262+
'biome-integration-world/cakeworld-biome-integration.properties').asFile
263+
if (!marker.isFile()) {
264+
throw new GradleException("Biome integration completion marker is missing: ${marker}")
265+
}
266+
Properties result = new Properties()
267+
marker.withInputStream { result.load(it) }
268+
if (result.getProperty('reload_verified') != 'true') {
269+
throw new GradleException("Biome integration reload was not verified: ${marker}")
270+
}
271+
File eulaFile = biomeIntegrationRunDirectory.get().file('eula.txt').asFile
272+
if (eulaFile.exists()) {
273+
throw new GradleException("Biome integration test unexpectedly created an EULA file: ${eulaFile}")
274+
}
275+
logger.lifecycle('Custom-biome integration verified: {} chunks, {} top blocks, {} filler blocks, fresh + reload',
276+
result.getProperty('matching_chunks'), result.getProperty('pink_surface'),
277+
result.getProperty('white_filler'))
278+
}
279+
}
280+
281+
tasks.named('check') {
282+
dependsOn biomeIntegrationTest
283+
}
284+
192285
idea {
193286
module {
194287
downloadSources = true

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 NeoForge 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.
5+
Start with [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-
- NeoForge 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/DEVELOPER_GUIDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,11 @@ 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 biome
202+
integration test. It loads a separate test provider and datapack biome, proves
203+
the provider is active, verifies biome selection, tags, climate and configured
204+
surface blocks in non-flat terrain, then reopens and rechecks the same saved
205+
world. Run `gradlew check` (or `gradlew build`, which includes it) before
206+
publishing any change to biome registration, palettes, surfaces or profile
207+
persistence.

gradle.properties

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

0 commit comments

Comments
 (0)