Public Access
95 lines
3.4 KiB
Groovy
95 lines
3.4 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'net.neoforged.moddev' version '2.0.148'
|
|
}
|
|
|
|
group = 'net.dnorberg.rivencraft'
|
|
version = mod_version
|
|
|
|
base {
|
|
archivesName = "rivencraft-${minecraft_version}-INCOMPLETE"
|
|
}
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(25)
|
|
|
|
neoForge {
|
|
version = project.neo_version
|
|
runs {
|
|
client {
|
|
client()
|
|
if (project.hasProperty('connectAddress')) {
|
|
programArgument '--quickPlayMultiplayer'
|
|
programArgument project.property('connectAddress').toString()
|
|
}
|
|
if (project.hasProperty('clientName')) {
|
|
programArgument '--username'
|
|
programArgument project.property('clientName').toString()
|
|
gameDirectory = project.layout.buildDirectory.dir('run-client-' + project.property('clientName')).get().asFile
|
|
}
|
|
}
|
|
server {
|
|
server()
|
|
gameDirectory = project.hasProperty('serverRunDir')
|
|
? file(project.property('serverRunDir').toString())
|
|
: project.layout.buildDirectory.dir('run-server').get().asFile
|
|
programArgument '--nogui'
|
|
}
|
|
}
|
|
mods {
|
|
rivencraft {
|
|
sourceSet(sourceSets.main)
|
|
}
|
|
}
|
|
}
|
|
|
|
def generateModMetadata = tasks.register('generateModMetadata', ProcessResources) {
|
|
def replaceProperties = [
|
|
mod_id: mod_id,
|
|
mod_name: mod_name,
|
|
mod_license: mod_license,
|
|
mod_version: mod_version,
|
|
neo_version: neo_version,
|
|
minecraft_version_range: minecraft_version_range,
|
|
]
|
|
inputs.properties replaceProperties
|
|
expand replaceProperties
|
|
from 'src/main/templates'
|
|
into 'build/generated/sources/modMetadata'
|
|
}
|
|
sourceSets.main.resources.srcDir generateModMetadata
|
|
neoForge.ideSyncTask generateModMetadata
|
|
|
|
tasks.named('processResources', ProcessResources).configure {
|
|
// Reuse the existing sprite and base model without copying binary assets.
|
|
from('../../src/main/resources') {
|
|
include 'assets/rivencraft/textures/item/crystal_shard.png'
|
|
include 'assets/rivencraft/models/item/crystal_shard.json'
|
|
include 'assets/rivencraft/textures/item/descriptive_book.png'
|
|
include 'assets/rivencraft/models/item/descriptive_book.json'
|
|
include 'assets/rivencraft/textures/item/linking_book.png'
|
|
include 'assets/rivencraft/models/item/linking_book_bound.json'
|
|
include 'assets/rivencraft/textures/gui/bookui_cover.png'
|
|
include 'assets/rivencraft/textures/gui/notebook_pages.png'
|
|
include 'assets/rivencraft/textures/gui/bookui_pager.png'
|
|
include 'assets/rivencraft/textures/block/crystal_block.png'
|
|
include 'assets/rivencraft/models/block/crystal_block.json'
|
|
include 'assets/rivencraft/blockstates/crystal_block.json'
|
|
include 'data/rivencraft/loot_table/blocks/crystal_block.json'
|
|
}
|
|
}
|
|
|
|
// This partial 26.3 port is not a playable release. An explicitly requested
|
|
// local test JAR can be built with -PallowIncompletePortJar=true, but the
|
|
// default build must never produce a distributable artifact.
|
|
tasks.named('jar').configure {
|
|
enabled = providers.gradleProperty('allowIncompletePortJar').map(String::toBoolean).getOrElse(false)
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
tasks.named('runServer').configure {
|
|
standardInput = System.in
|
|
}
|