Two cohesive passes that harden the latitude worldgen and clean up
long-standing inconsistencies.
== Bug fixes & doc alignment ==
- licence: set MIT in gradle.properties and neoforge.mods.toml
(was "Not specified" - blocks distribution)
- OreAuditHandler: fix javadoc that referenced a non-existent system
property; the trigger is the .oreaudit marker file. Add an explicit
warning about the System.exit(0) and point to LatitudeGameTest as the
non-destructive alternative
- KubeJS: remove the dead kubejs_version, the commented dependency and
all README claims about an "automatic KubeJS script"/KubeJSIntegration
class that no longer exists. Vanilla ore removal is now native via the
neoforge:remove_features biome modifier
- README: refresh the technical header (1.21.1 / NeoForge 21.1.219 /
Java 21 / v3.2, was 1.20.1/Forge/Java17/v2.1.5) and the shard-diamond
surface note (both variants are generated, gated by shardDiamondOre)
- CLAUDE.md / CONFIG_INTEGRATION_GUIDE.md: mark the feature toggles and
tool stats as wired (they read ModConfigs at runtime); correct the
"hardcoded tools" claim
== Generation tests (56 unit + 6 GameTest, all green) ==
- Extract the pure geometry of LatitudeBiomeSource into LatitudeMath
(temperature, 3-zone underground model, spawn safe zone, dual-octave
selector index). LatitudeBiomeSource now delegates to it, so one
source of truth drives both runtime and tests - no behaviour drift
- LatitudeMathTest (21): temperature clamp/monotonicity, zone boundaries
without gaps, Deep Dark / cave threshold predicates, spawn-safe square
symmetry, selector index bounds + near-uniform distribution
- BiomeBandTest (18): fromTemperature boundary cases, surface/ocean
pool non-empty, cave biomes never in a surface pool
- ModConfigsTest (+2 guards): every ConfigHelper toggle string maps to
a real FeatureToggleConfig field, so a typo cannot silently produce a
dead toggle (default: return true)
- LatitudeGameTest (+4 server tests): determinism (1485 pts, 0 mismatch),
no cave biome at surface (160k samples, 0 leak), surface continuity
(7% transitions - large biomes), climate gradient (north=cold 100%,
south=hot 100%, equator cold 0%)
== Build ==
- build.gradle: addModdingDependenciesTo(sourceSets.test) so pure unit
tests can reference Minecraft types without a full game server
- neoforge.mods.toml: optional BOP/create/mekanism dependencies removed;
declared with mandatory=false + versionRange="[0,)" they broke mod
loading when the mods were absent ("requires X 0 or above"). Optional
integration is already handled via data tags (required:false) and
data-only recipes that no-op if the mod is missing
- gradlew: restore executable bit
Verification: ./gradlew test build -> BUILD SUCCESSFUL, 56/56 unit tests
./gradlew runGameTestServer -> 6/6 GameTests passed in 840ms
131 lines
3.4 KiB
Groovy
131 lines
3.4 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'eclipse'
|
|
id 'idea'
|
|
id 'maven-publish'
|
|
id 'net.neoforged.moddev' version '2.0.123'
|
|
}
|
|
|
|
tasks.named('wrapper', Wrapper).configure {
|
|
distributionType = Wrapper.DistributionType.BIN
|
|
}
|
|
|
|
version = mod_version
|
|
group = mod_group_id
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven {
|
|
name = "Jared's maven"
|
|
url = "https://maven.blamejared.com/"
|
|
}
|
|
maven {
|
|
name = "ModMaven"
|
|
url = "https://modmaven.dev"
|
|
}
|
|
}
|
|
|
|
base {
|
|
archivesName = mod_id
|
|
}
|
|
|
|
// NeoForge requires Java 21 - Gradle will automatically download it if needed
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
neoForge {
|
|
version = project.neo_version
|
|
|
|
// Default run configurations.
|
|
runs {
|
|
client {
|
|
client()
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
server {
|
|
server()
|
|
programArgument '--nogui'
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
gameTestServer {
|
|
type = 'gameTestServer'
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
data {
|
|
data()
|
|
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
|
}
|
|
|
|
configureEach {
|
|
systemProperty 'forge.logging.markers', 'REGISTRIES'
|
|
logLevel = org.slf4j.event.Level.DEBUG
|
|
}
|
|
}
|
|
|
|
mods {
|
|
"${mod_id}" {
|
|
sourceSet(sourceSets.main)
|
|
}
|
|
}
|
|
|
|
// Expose Minecraft + NeoForge classes to the 'test' source set so that pure
|
|
// unit tests can assert on worldgen types (e.g. BiomeBand, Biomes, TagKey)
|
|
// without needing a full game server. This mirrors how the 'main' source set
|
|
// is configured by the plugin. Run with: ./gradlew test
|
|
addModdingDependenciesTo(sourceSets.test)
|
|
}
|
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|
|
|
configurations {
|
|
runtimeClasspath.extendsFrom localRuntime
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
|
testImplementation 'org.mockito:mockito-core:4.5.1'
|
|
testImplementation 'org.mockito:mockito-junit-jupiter:4.5.1'
|
|
}
|
|
|
|
tasks.withType(ProcessResources).configureEach {
|
|
var replaceProperties = [
|
|
minecraft_version : minecraft_version,
|
|
minecraft_version_range : minecraft_version_range,
|
|
neo_version : neo_version,
|
|
neo_version_range : neo_version_range,
|
|
loader_version_range : loader_version_range,
|
|
mod_id : mod_id,
|
|
mod_name : mod_name,
|
|
mod_license : mod_license,
|
|
mod_version : mod_version,
|
|
mod_authors : mod_authors,
|
|
mod_description : mod_description
|
|
]
|
|
inputs.properties replaceProperties
|
|
filesMatching(['META-INF/neoforge.mods.toml']) {
|
|
expand replaceProperties
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
tasks.withType(Test).configureEach {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
idea {
|
|
module {
|
|
downloadSources = true
|
|
downloadJavadoc = true
|
|
}
|
|
}
|