- Fix ServerTickEvent: register listener for ServerTickEvent.Post instead of abstract ServerTickEvent base class (NeoForge 21.x requirement) - Fix null BlockGetter: replace null with EmptyBlockGetter.INSTANCE in isSolidRender() and propagatesSkylightDown() calls (1.21+ actually uses param) - Fix chunk iteration: replace direct visibleChunkMap field access with getChunks() iteration and getChunkToSend() with getLatestChunk() (1.21.1 API) - Build: fix shadowJar config to properly bundle DynmapCore into fat jar (was producing 80KB hollow jar missing all core classes) - Build: cap Gradle daemon and forked javac heap to prevent OOM on large hosts - Tested: server starts cleanly, Dynmap web UI accessible, maps rendered
87 lines
2.1 KiB
Groovy
87 lines
2.1 KiB
Groovy
plugins {
|
|
id 'eclipse'
|
|
id 'net.neoforged.gradle.userdev' version '7.1.20'
|
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
|
}
|
|
|
|
group = 'us.dynmap'
|
|
version = '3.7-SNAPSHOT-Dev'
|
|
archivesBaseName = 'Dynmap-neoforge-1.21.1'
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' Arch: ' + System.getProperty('os.arch'))
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://maven.neoforged.net/releases' }
|
|
maven { url 'https://libraries.minecraft.net' }
|
|
// Local file dependencies
|
|
flatDir { dirs 'libs' }
|
|
}
|
|
|
|
minecraft {
|
|
accessTransformers {
|
|
file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
shadow
|
|
implementation.extendsFrom shadow
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'net.neoforged:neoforge:21.1.219'
|
|
// DynmapCore bundled into the fat jar via shadow config
|
|
shadow fileTree(dir: 'libs', include: ['*.jar'])
|
|
}
|
|
|
|
processResources {
|
|
filesMatching('META-INF/neoforge.mods.toml') {
|
|
expand(
|
|
version: project.version,
|
|
mcversion: '1.21.1'
|
|
)
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
configurations = [project.configurations.shadow]
|
|
mergeServiceFiles()
|
|
|
|
archiveBaseName = 'Dynmap'
|
|
archiveVersion = project.version
|
|
archiveClassifier = 'neoforge-1.21.1'
|
|
|
|
// Exclude signature files that cause security exceptions
|
|
exclude 'META-INF/*.RSA'
|
|
exclude 'META-INF/*.SF'
|
|
exclude 'META-INF/*.DSA'
|
|
}
|
|
|
|
tasks.jar {
|
|
manifest {
|
|
attributes([
|
|
'Specification-Title': 'dynmap',
|
|
'Specification-Vendor': 'mikeprimm',
|
|
'Specification-Version': '1',
|
|
'Implementation-Title': project.name,
|
|
'Implementation-Version': project.version,
|
|
'Implementation-Vendor': 'mikeprimm',
|
|
])
|
|
}
|
|
}
|
|
|
|
// Build the fat jar, not the thin one
|
|
build.dependsOn(shadowJar)
|
|
|
|
// Cap memory on forked javac process (prevents OOM on large NeoForge compile)
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.fork = true
|
|
options.forkOptions.memoryMaximumSize = '3g'
|
|
}
|