Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Benjamin Plain (bplainia)
Jacob Hayes (tigerbird1)
Milan Damen (milandamen)
Daniel Schmidt (Danielxs01)
Anthony/Angelina Michalek (Codetoil)
254 changes: 116 additions & 138 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
buildscript {
repositories {
maven { url "https://maven.neoforged.net/releases" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://repo.spongepowered.org/maven' }
mavenCentral()
}
dependencies {
classpath group: 'net.neoforged.gradle', name: 'userdev', version: '7.1.11'
classpath group: 'net.neoforged.gradle', name: 'common', version: '7.1.11'
classpath "com.gradleup.shadow:shadow-gradle-plugin:9.2.2"
}
}

apply plugin: 'net.neoforged.gradle.userdev'
apply plugin: 'net.neoforged.gradle.common'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'com.gradleup.shadow'

configurations {
shade
implementation.extendsFrom shade
minecraftLibrary
implementation.extendsFrom minecraftLibrary
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[7.0.23,8.0)'
id 'net.minecraftforge.jarjar' version '0.2.3'
}

java {
Expand All @@ -44,85 +25,96 @@ if (!"release".equalsIgnoreCase(System.getProperty("target"))) {
umcVersion += "-unknown"
}
}
version = "1.21.1-neoforge-" + umcVersion
version = "1.21.1-forge-" + umcVersion
group = "cam72cam.universalmodcore" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "UniversalModCore"
base.archivesName = "UniversalModCore"

java.toolchain.languageVersion = JavaLanguageVersion.of(21)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
// applies to all the run configs below
configureEach {
//Enable mixin-ed dependency in deobfuscated environment
systemProperty "mixin.env.remapRefMap", "true"
systemProperty "mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg"

systemProperty "mixin.debug.verbose", "true"
systemProperty "mixin.debug.export", "true"
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
systemProperty 'forge.logging.console.level', 'debug'

dependencies {
runtime project.configurations.minecraftLibrary
minecraft {
mappings channel: "official", version: "1.21.1"
accessTransformer = true

runs {
// applies to all the run configs below
configureEach {
workingDir.convention layout.projectDirectory.dir('run')
// Mixin requires either specifying the config via command line, or in the Manifest
args "--mixin.config=universalmodcore.feat.mixins.json", "--mixin.config=universalmodcore.fix.mixins.json"

systemProperty "mixin.debug.verbose", "true"
systemProperty "mixin.debug.export", "true"
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
systemProperty 'forge.logging.console.level', 'debug'
}

modSource project.sourceSets.main
}

client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', 'universalmodcore'
}
register('client') {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'forge.enabledGameTestNamespaces', 'universalmodcore'
}

server {
systemProperty 'neoforge.enabledGameTestNamespaces', 'universalmodcore'
argument '--nogui'
}
register('server') {
systemProperty 'forge.enabledGameTestNamespaces', 'universalmodcore'
args '--nogui'
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
systemProperty 'neoforge.enabledGameTestNamespaces', 'universalmodcore'
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
register('gameTestServer') {
systemProperty 'forge.enabledGameTestNamespaces', 'universalmodcore'
}

data {
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// workingDirectory project.file('run-data')
register('data') {
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// workingDirectory project.file('run-data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
arguments.addAll '--mod', 'universalmodcore', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'universalmodcore', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
}

accessTransformers {
file 'src/main/resources/META-INF/accesstransformer.cfg'
}
sourceSets.main.resources { srcDir layout.projectDirectory.dir('src/generated/resources') }

repositories {
mavenCentral()
// This methods registers jarJar for the default jar task.
// The closure allows you to configure the task, instead of needing to do this:
// tasks.named('jarJar', net.minecraftforge.jarjar.gradle.JarJar)
jarJar.register() {
archiveClassifier = null
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven { url = "https://repo.spongepowered.org/maven" }
minecraft.mavenizer(it)
maven fg.forgeMaven
maven fg.minecraftLibsMaven
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
filter {
includeGroupAndSubgroups('org.spongepowered')
}
}
mavenCentral()
mavenLocal()
}

dependencies {
implementation "net.neoforged:neoforge:21.1.216"
implementation minecraft.dependency("net.minecraftforge:forge:1.21.1-52.1.14")
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
Expand All @@ -143,13 +135,29 @@ dependencies {
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
// annotationProcessor('org.spongepowered:mixin:0.8.3:processor')
// annotationProcessor('io.github.llamalad7:mixinextras-common:0.5.0')
compileOnly(annotationProcessor('io.github.llamalad7:mixinextras-common:0.5.0'))
implementation(jarJar('io.github.llamalad7:mixinextras-forge:0.5.0')) {
jarJar.configure(it) {
module {
group = 'io.github.llamalad7'
name = 'mixinextras'
}
range = "[0.5.0,)"
}
}

//testImplementation ('junit:junit:4.13')
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.2'

minecraftLibrary(shade group: 'javax.vecmath', name: 'vecmath', version: '1.5.2')
implementation(jarJar(group: 'javax.vecmath', name: 'vecmath', version: '1.5.2')) {
jarJar.configure(it) {
module {
group = 'javax.vecmath'
name = 'vecmath'
}
version = "1.5.2"
}
}
// implementation(shade group: 'at.yawk.lz4', name: 'lz4-java', version: '1.10.2')
}

Expand All @@ -167,31 +175,8 @@ dependencies {
attributesSchema {
attribute(mappingsAttribute)
}

//Iris
implementation "curse.maven:sodium-394468:6382651"
implementation "curse.maven:irisshaders-455508:6661598"

//Lamb Dynamic Lights
compileOnly("dev.lambdaurora.lambdynamiclights:lambdynamiclights-api:4.8.7+1.21.1") {
attributes {
attribute(mappingsAttribute, "mojmap")
}
}
runtimeOnly "curse.maven:lambdynamiclights-393442:7306458"
}

//mixin {
// add sourceSets.main, 'mixins.universalmodcore.refmap.json'
//
// config 'mixins.universalmodcore.json'
//
// //Dev environment setup
// debug.verbose = true
// debug.export = true
// dumpTargetOnFailure = true
//}

jar {
archiveClassifier = 'slim'
manifest {
Expand All @@ -202,44 +187,21 @@ jar {
"Implementation-Title": project.name,
"Implementation-Version": umcVersion,
"Implementation-Vendor" :"",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"MixinConfigs" : "universalmodcore.feat.mixins.json, universalmodcore.fix.mixins.json"
])
}
}

//No need in Neoforge
//jar.finalizedBy('reobfJar')

shadowJar {
archiveClassifier = ''
configurations = [project.configurations.shade]
relocate 'javax.vecmath', "${project.group}.shade.javax.vecmath"
//Don't do this
// relocate 'org.spongepowered', "${project.group}.shade.org.spongepowered"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
mergeServiceFiles()
// finalizedBy 'reobfShadowJar'
}

assemble.dependsOn shadowJar

//reobf {
// shadowJar {}
//}

test {
useJUnit()
maxHeapSize = '1G'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact shadowJar
artifact sourcesJar
artifactId archivesBaseName
}
publications.register('mavenJava', MavenPublication) {
artifact tasks.named("jar")
artifact tasks.named("jarJar")
artifact tasks.named("sourcesJar")
}
repositories {
maven {
Expand All @@ -264,3 +226,19 @@ tasks.register('showBuildInfo') {
}

publish.finalizedBy showBuildInfo

// IntelliJ no longer downloads javadocs and sources by default, this tells Gradle to force IntelliJ to do it.
idea.module { downloadJavadoc = downloadSources = true }

eclipse {
// Eclipse no longer downloads javadocs and sources by default, this tells Gradle to force Eclipse to do it.
classpath { downloadJavadoc = downloadSources = true }

// NOTE: ForgeGradle 7 does not yet support Eclipse run configurations
// Run everytime eclipse builds the code
//autoBuildTasks genEclipseRuns
// Run when importing the project
//synchronizationTasks 'genEclipseRuns'
}

// NOTE: Merging of source sets is now controlled by the property 'net.minecraftforge.gradle.merge-source-sets'
14 changes: 9 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
# Forge why you so broken???
org.gradle.daemon=false
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand=true

org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.configuration-cache.problems=warn

net.minecraftforge.gradle.merge-source-sets=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
Loading