Skip to content

Commit 69843d4

Browse files
committed
Backport OreSpawn 4.0.5 to NeoForge 1.20.6
1 parent 4422fa3 commit 69843d4

29 files changed

Lines changed: 2141 additions & 1544 deletions

File tree

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.20.6 ResourceLocation constructor 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# OreSpawn Documentation For Coding Agents
1+
# OreSpawn Documentation Map
22

3-
This index is for coding agents working on other mods or modpacks that integrate
4-
with OreSpawn. Start with [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md).
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).
56

67
Use the focused guides for implementation details:
78

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)