-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- updated to Minecraft 1.20.4 (Forge 49.0.38, Neoforge 20.4.225)
- updated JEI support to 1.20.4-17.3.0.49 (Forge & Neoforge) - updated The One Probe support to 1.20.4_neo-11.0.2-3 (Neoforge) - rename config option "recipeBlacklist" to "recipeBlockedList"
- Loading branch information
Showing
115 changed files
with
1,634 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ build | |
# other | ||
eclipse | ||
run | ||
runs | ||
run-data | ||
|
||
# Files from Forge MDK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,174 +1,93 @@ | ||
plugins { | ||
id 'eclipse' | ||
id 'idea' | ||
id 'maven-publish' | ||
id 'net.minecraftforge.gradle' version '[6.0,6.2)' | ||
// Required for NeoGradle | ||
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" | ||
} | ||
|
||
version = "${minecraft_version}-${mod_version}" | ||
group = mod_group_id | ||
base { | ||
archivesName = mod_id | ||
} | ||
|
||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
|
||
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" | ||
minecraft { | ||
mappings channel: 'official', version: minecraft_version | ||
|
||
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game. | ||
// In most cases, it is not necessary to enable. | ||
// enableEclipsePrepareRuns = true | ||
// enableIdeaPrepareRuns = true | ||
|
||
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game. | ||
// It is REQUIRED to be set to true for this template to function. | ||
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html | ||
copyIdeResources = true | ||
|
||
// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations. | ||
// The folder name can be set on a run configuration using the "folderName" property. | ||
// By default, the folder name of a run configuration is the name of the Gradle project containing it. | ||
// generateRunFolders = true | ||
|
||
// See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information. | ||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
|
||
// Default run configurations. | ||
runs { | ||
// applies to all the run configs below | ||
configureEach { | ||
workingDirectory project.file('run') | ||
|
||
// 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. | ||
property '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 | ||
property 'forge.logging.console.level', 'debug' | ||
|
||
mods { | ||
"${mod_id}" { | ||
source sourceSets.main | ||
source sourceSets.test | ||
} | ||
} | ||
} | ||
|
||
client { | ||
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces. | ||
property 'forge.enabledGameTestNamespaces', mod_id | ||
subprojects { | ||
apply plugin: 'java' | ||
|
||
version "$project.minecraft_version-$project.mod_version" | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
//java.withSourcesJar() | ||
//java.withJavadocJar() | ||
|
||
jar { | ||
from(rootProject.file("LICENSE")) | ||
manifest { | ||
attributes([ | ||
'Specification-Title' : mod_id, | ||
'Specification-Vendor' : mod_author, | ||
'Specification-Version' : project.jar.archiveVersion, | ||
'Implementation-Title' : project.name, | ||
'Implementation-Version' : project.jar.archiveVersion, | ||
'Implementation-Vendor' : mod_author, | ||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
'Timestamp' : System.currentTimeMillis(), | ||
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", | ||
'Built-On-Minecraft' : minecraft_version | ||
]) | ||
} | ||
} | ||
|
||
server { | ||
property 'forge.enabledGameTestNamespaces', mod_id | ||
args '--nogui' | ||
} | ||
//sourcesJar { | ||
// from(rootProject.file("LICENSE")) | ||
//} | ||
|
||
gameTestServer { | ||
property 'forge.enabledGameTestNamespaces', mod_id | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = 'Sponge / Mixin' | ||
url = 'https://repo.spongepowered.org/repository/maven-public/' | ||
} | ||
|
||
data { | ||
// example of overriding the workingDirectory set in configureEach above | ||
workingDirectory project.file('run-data') | ||
|
||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. | ||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') | ||
maven { | ||
name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)' | ||
url = 'https://maven.blamejared.com' | ||
} | ||
} | ||
} | ||
|
||
// Include resources generated by data generators. | ||
sourceSets.main.resources { srcDir 'src/generated/resources' } | ||
|
||
repositories { | ||
maven { | ||
// location of the maven that hosts JEI files since January 2023 | ||
name = "Jared's maven" | ||
url = "https://maven.blamejared.com/" | ||
} | ||
maven { | ||
// location of a maven mirror for JEI files, as a fallback | ||
name = "ModMaven" | ||
url = "https://modmaven.k-4u.nl" | ||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = 'UTF-8' | ||
it.options.getRelease().set(17) | ||
} | ||
maven { // TOP | ||
url "https://maven.k-4u.nl" | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" | ||
|
||
// compile against the JEI API but do not include it at runtime | ||
compileOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}-common-api:${project.jei_version}") | ||
compileOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") | ||
// at runtime, use the full JEI jar | ||
runtimeOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") | ||
|
||
//implementation fg.deobf("mcjty.theoneprobe:theoneprobe:$top_version") {transitive = false} | ||
} | ||
|
||
tasks.named('processResources', ProcessResources).configure { | ||
var replaceProperties = [ | ||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, | ||
forge_version: forge_version, forge_version_range: forge_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, mod_issue_tracker: mod_issue_tracker, | ||
mod_url: mod_url, | ||
jei_version_range: jei_version_range, top_version_range: top_version_range | ||
] | ||
inputs.properties replaceProperties | ||
|
||
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { | ||
expand replaceProperties + [project: project] | ||
} | ||
} | ||
|
||
tasks.named('jar', Jar).configure { | ||
manifest { | ||
attributes([ | ||
'Specification-Title' : mod_id, | ||
'Specification-Vendor' : mod_authors, | ||
'Specification-Version' : project.jar.archiveVersion, | ||
'Implementation-Title' : project.name, | ||
'Implementation-Version' : project.jar.archiveVersion, | ||
'Implementation-Vendor' : mod_authors, | ||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
|
||
// This is the preferred method to reobfuscate your jar file | ||
finalizedBy 'reobfJar' | ||
} | ||
|
||
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing: | ||
// tasks.named('publish').configure { | ||
// dependsOn 'reobfJar' | ||
// } | ||
|
||
publishing { | ||
publications { | ||
register('mavenJava', MavenPublication) { | ||
artifact jar | ||
processResources { | ||
def expandProps = [ | ||
"version": version, | ||
"group": project.group, //Else we target the task's group. | ||
"minecraft_version": minecraft_version, | ||
"minecraft_version_range": minecraft_version_range, | ||
"forge_version": forge_version, | ||
"forge_version_range": forge_version_range, | ||
"forge_loader_version_range": forge_loader_version_range, | ||
//"fabric_version": fabric_version, | ||
//"fabric_loader_version": fabric_loader_version, | ||
"neoforge_version": neoforge_version, | ||
"neoforge_version_range": neoforge_version_range, | ||
"neoforge_loader_version_range": neoforge_loader_version_range, | ||
"mod_id": mod_id, | ||
"mod_name": mod_name, | ||
"mod_author": mod_author, | ||
"mod_license": mod_license, | ||
"mod_url": mod_url, | ||
"mod_issue_tracker": mod_issue_tracker, | ||
"mod_description": project.description, | ||
"jei_version": jei_version, | ||
"jei_version_range": jei_version_range, | ||
"top_version": top_version, | ||
"top_version_range": top_version_range | ||
] | ||
|
||
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { | ||
expand expandProps | ||
} | ||
inputs.properties(expandProps) | ||
} | ||
repositories { | ||
maven { | ||
url "file://${project.projectDir}/mcmodsrepo" | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation | ||
} | ||
// Disables Gradle's custom module metadata from being published to maven. The | ||
// metadata includes mapped dependencies which are not reasonably consumable by | ||
// other mod developers. | ||
tasks.withType(GenerateModuleMetadata).configureEach { | ||
enabled = false | ||
} | ||
} |
Oops, something went wrong.