Skip to content

Commit a7fdbb2

Browse files
authored
Merge pull request #295 from SkyBlade1978/master-1.13.2
Port OreSpawn 4.0.16 to Forge 1.13.2
2 parents 64c4b05 + eab2cd0 commit a7fdbb2

28 files changed

Lines changed: 1045 additions & 75 deletions

‎.github/workflows/ci.yml‎

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,67 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
cold-forge-bootstrap:
21+
name: Cold Forge bootstrap
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 60
24+
25+
steps:
26+
- name: Check out source
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
29+
- name: Install pinned Java 25 ForgeGradle Mavenizer runtime
30+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
31+
with:
32+
distribution: temurin
33+
java-version: '25.0.3+9.0.LTS'
34+
35+
- name: Install pinned Java 8 compilation toolchain
36+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
37+
with:
38+
distribution: temurin
39+
java-version: '8.0.502+7'
40+
41+
- name: Install pinned Java 17 Gradle runtime
42+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
43+
with:
44+
distribution: temurin
45+
java-version: '17.0.1+12'
46+
47+
- name: Bootstrap Forge from an empty cache
48+
shell: bash
49+
env:
50+
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
51+
run: |
52+
set -euo pipefail
53+
test ! -e .gradle
54+
test ! -e "$GRADLE_USER_HOME"
55+
mkdir -p "$GRADLE_USER_HOME"
56+
chmod +x ./gradlew
57+
gradle_args=(
58+
classes verifyLegacyFixtures
59+
--no-daemon --no-build-cache --stacktrace --max-workers=2
60+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
61+
-Dorg.gradle.java.installations.auto-detect=false
62+
-Dorg.gradle.java.installations.auto-download=false
63+
)
64+
./gradlew "${gradle_args[@]}"
65+
66+
- name: Verify same-cache bootstrap offline
67+
shell: bash
68+
env:
69+
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
70+
run: |
71+
set -euo pipefail
72+
gradle_args=(
73+
classes verifyLegacyFixtures
74+
--rerun-tasks --offline --no-daemon --no-build-cache --stacktrace --max-workers=2
75+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
76+
-Dorg.gradle.java.installations.auto-detect=false
77+
-Dorg.gradle.java.installations.auto-download=false
78+
)
79+
./gradlew "${gradle_args[@]}"
80+
2081
build:
2182
name: Build, test, and audit
2283
runs-on: ubuntu-latest
@@ -26,17 +87,23 @@ jobs:
2687
- name: Check out source
2788
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2889

29-
- name: Install Java 8 toolchain
90+
- name: Install pinned Java 25 ForgeGradle Mavenizer runtime
91+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
92+
with:
93+
distribution: temurin
94+
java-version: '25.0.3+9.0.LTS'
95+
96+
- name: Install pinned Java 8 compilation toolchain
3097
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
3198
with:
3299
distribution: temurin
33100
java-version: '8.0.502+7'
34101

35-
- name: Install Java 17 for Gradle
102+
- name: Install pinned Java 17 Gradle runtime
36103
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
37104
with:
38-
distribution: microsoft
39-
java-version: '17'
105+
distribution: temurin
106+
java-version: '17.0.1+12'
40107

41108
- name: Set up Gradle
42109
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
@@ -48,6 +115,9 @@ jobs:
48115
run: >-
49116
./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums
50117
verifyEclipseProductionClasspath --no-daemon --stacktrace
118+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
119+
-Dorg.gradle.java.installations.auto-detect=false
120+
-Dorg.gradle.java.installations.auto-download=false
51121
52122
- name: Upload audited release candidate
53123
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
@@ -56,9 +126,9 @@ jobs:
56126
if-no-files-found: error
57127
retention-days: 30
58128
path: |
59-
build/libs/OreSpawn-4.0.8.113021.jar
60-
build/libs/OreSpawn-4.0.8.113021-sources.jar
61-
build/libs/OreSpawn-4.0.8.113021-javadoc.jar
129+
build/libs/OreSpawn-4.0.16.113021.jar
130+
build/libs/OreSpawn-4.0.16.113021-sources.jar
131+
build/libs/OreSpawn-4.0.16.113021-javadoc.jar
62132
build/release/SHA256SUMS
63133
CHANGELOG.txt
64134

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,23 @@ jobs:
2626
- name: Check out source
2727
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2828

29-
- name: Install Java 8 toolchain
29+
- name: Install pinned Java 25 ForgeGradle Mavenizer runtime
30+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
31+
with:
32+
distribution: temurin
33+
java-version: '25.0.3+9.0.LTS'
34+
35+
- name: Install pinned Java 8 compilation toolchain
3036
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
3137
with:
3238
distribution: temurin
3339
java-version: '8.0.502+7'
3440

35-
- name: Install Java 17 for Gradle
41+
- name: Install pinned Java 17 Gradle runtime
3642
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
3743
with:
38-
distribution: microsoft
39-
java-version: '17'
44+
distribution: temurin
45+
java-version: '17.0.1+12'
4046

4147
- name: Set up Gradle
4248
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
@@ -49,7 +55,14 @@ jobs:
4955
- name: Compile production code
5056
run: |
5157
chmod +x ./gradlew
52-
./gradlew clean classes --no-daemon --stacktrace
58+
gradle_args=(
59+
clean classes
60+
--no-daemon --stacktrace --max-workers=2
61+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
62+
-Dorg.gradle.java.installations.auto-detect=false
63+
-Dorg.gradle.java.installations.auto-download=false
64+
)
65+
./gradlew "${gradle_args[@]}"
5366
5467
- name: Analyze
5568
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4

‎CHANGELOG.txt‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
Version 4.0.16.113021
2+
3+
* Adopt the shared 4.0.16 release identity. Forge 1.13 has neither
4+
three-dimensional biome-cell attribution nor a server-side GameTest harness,
5+
so the 4.0.15 attribution and 4.0.16 GameTest lifecycle repairs are not
6+
applicable on this target.
7+
* Ordinary dedicated benchmark servers continue to stop automatically when
8+
requested.
9+
10+
Version 4.0.14.113021
11+
12+
* Convert exposed one-layer vanilla Snow from the first free cell immediately
13+
above Minecraft's motion-blocking surface when a dimension supplies a custom
14+
snow material.
15+
* Retain the existing surface Ice conversion and leave buried or authored Snow
16+
and Ice unchanged.
17+
18+
Version 4.0.13.113021
19+
20+
* Give the public ore-dimension builder the exact biome include/exclude and
21+
biome-dictionary filter support already available in provider JSON.
22+
* Accept valid namespaced geome IDs in both creation-editor validation paths
23+
while preserving legacy unnamespaced geome keys.
24+
* API major 1, schemas, existing profiles, generated chunks, and worldgen
25+
behaviour are unchanged.
26+
27+
Version 4.0.10.113021
28+
29+
* Evaluate Stable Layers rock min_y and max_y bounds against actual world Y
30+
instead of the vertically shifted formation coordinate.
31+
* Preserve the shifted formation identity for layer, family, and rock choice
32+
while preventing vanilla Stone fallback near dimension floors and ceilings.
33+
* Apply the correction only while generating new chunks; existing chunks and
34+
saved profiles remain unchanged.
35+
36+
Version 4.0.9.113021
37+
38+
* Replace provider-declared natural terrain hosts during the existing geology
39+
scan before structure and vegetation features can author matching blocks.
40+
* Keep air, fluids, bedrock, and block entities protected even when their block
41+
IDs are mistakenly declared as terrain hosts.
42+
* Apply the correction only while generating new chunks; existing chunks and
43+
saved profiles remain unchanged.
44+
145
Version 4.0.8.113021
246

347
* Preserve long host, tag, and biome-list values when OreSpawn editors load

‎README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ End" policy used by mods such as Base Metals.
1717
This is not the unrelated mod that adds mobs and dimensions under the same
1818
name.
1919

20-
This branch builds target-qualified version `4.0.8.113021`: the OreSpawn 4.0.8
20+
This branch builds target-qualified version `4.0.16.113021`: the OreSpawn 4.0.16
2121
feature set for Minecraft 1.13.2 and Forge. See the
2222
[versioning policy](docs/VERSIONS.md) for the encoding and release convention.
2323

@@ -95,9 +95,11 @@ exported to `config/orespawn-guide/` without overwriting existing files.
9595

9696
## Building
9797

98-
Run Gradle with Java 17 from the repository root. Install the exact Temurin
99-
`8.0.502+7` toolchain used to compile production code and test fixtures for
100-
Minecraft 1.13.2; the build rejects a different Java 8 toolchain:
98+
Run Gradle with Java 17 from the repository root. Install exact Temurin
99+
`25.0.3+9` for ForgeGradle's Mavenizer and exact Temurin `8.0.502+7` for the
100+
Minecraft 1.13.2 compilation and fixture toolchain. Java 17 remains the Gradle
101+
runtime, while production bytecode remains Java 8; the build rejects a
102+
different Java 8 toolchain:
101103

102104
```powershell
103105
.\gradlew.bat clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums --no-daemon

‎build.gradle‎

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import groovy.json.JsonSlurper
2+
import groovy.xml.XmlSlurper
23
import java.nio.charset.StandardCharsets
34
import java.security.MessageDigest
45
import java.util.jar.Manifest
@@ -35,6 +36,9 @@ if (versionParts[3] != expectedTargetVersion) {
3536
ext.functional_version = versionParts[0..2].join('.')
3637
ext.display_version = project.mod_version
3738
ext.release_tag = project.mod_version
39+
def expectedMavenGroup = 'zone.moddev.mc.orespawn'
40+
def expectedMavenArtifact = 'OreSpawn'
41+
def expectedMavenCoordinate = "${expectedMavenGroup}:${expectedMavenArtifact}:${project.version}"
3842

3943
java {
4044
toolchain {
@@ -462,6 +466,7 @@ level-name=surface-integration-world
462466
level-seed=zsjpxah
463467
level-type=default
464468
online-mode=false
469+
server-port=0
465470
allow-nether=true
466471
generate-structures=false
467472
spawn-protection=0
@@ -671,7 +676,7 @@ tasks.named('jar', Jar) {
671676
'Implementation-Vendor' : 'SkyBlade1978',
672677
'OreSpawn-API-Version' : '1',
673678
'FMLAT' : 'accesstransformer.cfg',
674-
'Maven-Artifact' : "${project.group}:${base.archivesName.get()}:${project.version}",
679+
'Maven-Artifact' : expectedMavenCoordinate,
675680
'Built-On-Java' : '8',
676681
'Built-On' : "${project.minecraft_version}-${project.forge_version}"
677682
])
@@ -727,7 +732,8 @@ def preparedReleaseDir = providers.gradleProperty('preparedReleaseDir')
727732
tasks.register('verifyReleaseConfiguration') {
728733
group = 'verification'
729734
doLast {
730-
if (project.mod_version != '4.0.8.113021'
735+
if (project.mod_version != '4.0.16.113021'
736+
|| project.mod_group != expectedMavenGroup
731737
|| project.minecraft_version != '1.13.2'
732738
|| project.forge_version != '25.0.223'
733739
|| project.mapping_channel != 'snapshot'
@@ -740,11 +746,11 @@ tasks.register('verifyReleaseConfiguration') {
740746
throw new GradleException('Unexpected dispatcher or Java target metadata')
741747
}
742748
List<String> expectedPublicArtifacts = [
743-
'OreSpawn-4.0.8.113021.jar',
744-
'OreSpawn-4.0.8.113021-sources.jar',
745-
'OreSpawn-4.0.8.113021-javadoc.jar'
749+
'OreSpawn-4.0.16.113021.jar',
750+
'OreSpawn-4.0.16.113021-sources.jar',
751+
'OreSpawn-4.0.16.113021-javadoc.jar'
746752
]
747-
if (base.archivesName.get() != 'OreSpawn'
753+
if (base.archivesName.get() != expectedMavenArtifact
748754
|| expectedReleaseFiles.get().collect { it.toString() } != expectedPublicArtifacts) {
749755
throw new GradleException('Public artifacts must use the version-only OreSpawn filename contract')
750756
}
@@ -759,7 +765,7 @@ tasks.register('verifyReleaseConfiguration') {
759765
'src/main/java/zone/moddev/mc/orespawn/worldgen/LegacyMineralogyProfileMigration.java',
760766
'README.md', 'CHANGELOG.txt'
761767
].each { path ->
762-
if (!file(path).getText('UTF-8').contains('4.0.8.113021')) {
768+
if (!file(path).getText('UTF-8').contains('4.0.16.113021')) {
763769
throw new GradleException("Release identity missing from ${path}")
764770
}
765771
}
@@ -871,6 +877,7 @@ tasks.register('verifyReleaseArtifacts') {
871877
|| manifest.getValue('Implementation-Version') != project.mod_version
872878
|| manifest.getValue('OreSpawn-API-Version') != '1'
873879
|| manifest.getValue('FMLAT') != 'accesstransformer.cfg'
880+
|| manifest.getValue('Maven-Artifact') != expectedMavenCoordinate
874881
|| manifest.getValue('Implementation-Timestamp') != null) {
875882
throw new GradleException('Release manifest is incorrect or volatile')
876883
}
@@ -969,8 +976,8 @@ def mavenUploadPassword = providers.environmentVariable('MAVEN_UPLOAD_PASSWORD')
969976
publishing {
970977
publications {
971978
mavenJava(MavenPublication) {
972-
groupId = project.group.toString()
973-
artifactId = base.archivesName.get()
979+
groupId = expectedMavenGroup
980+
artifactId = expectedMavenArtifact
974981
version = project.version.toString()
975982
if (preparedReleaseDir.isPresent()) {
976983
File prepared = file(preparedReleaseDir.get())
@@ -1006,6 +1013,26 @@ publishing {
10061013
}
10071014
}
10081015
}
1016+
tasks.register('verifyMavenCoordinates') {
1017+
group = 'verification'
1018+
description = 'Verifies the generated POM uses OreSpawn\'s mod-specific Maven namespace.'
1019+
dependsOn tasks.named('generatePomFileForMavenJavaPublication')
1020+
doLast {
1021+
File pomFile = layout.buildDirectory.file(
1022+
'publications/mavenJava/pom-default.xml').get().asFile
1023+
if (!pomFile.isFile()) {
1024+
throw new GradleException("Generated Maven POM does not exist: ${pomFile}")
1025+
}
1026+
def pom = new XmlSlurper(false, false).parse(pomFile)
1027+
def actual = [pom.groupId.text(), pom.artifactId.text(), pom.version.text()]
1028+
def expected = [expectedMavenGroup, expectedMavenArtifact,
1029+
project.version.toString()]
1030+
if (project.group.toString() != expectedMavenGroup || actual != expected) {
1031+
throw new GradleException("Expected Maven coordinate ${expected.join(':')}, " +
1032+
"found ${actual.join(':')}")
1033+
}
1034+
}
1035+
}
10091036
tasks.register('validateMavenReleaseCredentials') {
10101037
group = 'publishing'
10111038
doLast {
@@ -1021,11 +1048,14 @@ tasks.register('validateMavenReleaseCredentials') {
10211048
}
10221049
tasks.withType(PublishToMavenRepository).configureEach {
10231050
dependsOn tasks.named('validateMavenReleaseCredentials')
1051+
dependsOn tasks.named('verifyMavenCoordinates')
10241052
dependsOn preparedReleaseDir.isPresent()
10251053
? tasks.named('verifyPreparedReleaseArtifacts')
10261054
: tasks.named('verifyReleaseArtifacts')
10271055
}
10281056

1057+
tasks.named('check') { dependsOn tasks.named('verifyMavenCoordinates') }
1058+
10291059
eclipse {
10301060
classpath {
10311061
downloadSources = true
@@ -1184,6 +1214,7 @@ level-name=surface-integration-world
11841214
level-seed=zsjpxah
11851215
level-type=default
11861216
online-mode=false
1217+
server-port=0
11871218
allow-nether=true
11881219
generate-structures=false
11891220
spawn-protection=0

‎docs/API.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ WorldgenProvider provider = WorldgenProvider.builder("examplemod", 1)
8383
`OilDefinition` and template `.oil(...)` remain deprecated migration adapters
8484
for one legacy oil rule. New integrations should use `FluidDepositDefinition`.
8585

86+
Ore dimension builders expose the same biome filters as provider JSON and
87+
fluid-deposit builders. Use `.biome(...)` and `.biomeDictionary(...)` for
88+
inclusions, with `.excludeBiome(...)` and `.excludeBiomeDictionary(...)` for
89+
exclusions. These methods work on both explicit `.dimension(...)` rules and
90+
`.dimensionSelector(...)` fallbacks; built definitions and their returned
91+
filter sets are immutable.
92+
8693
Create one `BiomeRegistrar` during normal mod construction. It attaches to the
8794
calling mod's event bus and defers biome factories until Forge's biome registry
8895
event. `OreSpawnBiomes.copyAndRegister` clones a known biome without adding a

‎docs/BIOMES.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ lets OreSpawn replace the actual exposed ground while preserving later trees,
133133
plants, authored structures, and block entities. In ceiling dimensions,
134134
`ceiling_block` applies to the roof underside and does not replace the roof top.
135135

136+
Provider-declared `terrain_dimensions.host_blocks` are resolved by one terrain
137+
scan at the start of `LOCAL_MODIFICATIONS`, immediately before provider
138+
surfaces. Matching natural blocks already present in base terrain are eligible
139+
for geology; matching blocks authored by later structure or vegetation stages
140+
are not. Air, fluids, bedrock, and block-entity states remain protected even if
141+
a provider mistakenly lists their block IDs as terrain hosts.
142+
136143
Surface correction is generation-only. Installing or updating OreSpawn does
137144
not rewrite already generated chunks; travel into new terrain to see a changed
138145
provider surface definition.

0 commit comments

Comments
 (0)