11plugins {
2- id ' fabric-loom' version ' 0.5 -SNAPSHOT'
2+ id ' fabric-loom' version ' 0.8 -SNAPSHOT'
33 id ' maven-publish'
44}
55
6- sourceCompatibility = JavaVersion . VERSION_1_8
7- targetCompatibility = JavaVersion . VERSION_1_8
6+ sourceCompatibility = JavaVersion . VERSION_16
7+ targetCompatibility = JavaVersion . VERSION_16
88
99archivesBaseName = project. archives_base_name
1010version = project. mod_version
@@ -14,52 +14,51 @@ minecraft {
1414}
1515
1616repositories {
17+ maven { url " https://maven.terraformersmc.com/releases" }
1718 maven { url " https://jitpack.io" }
1819}
1920
2021dependencies {
2122 // to change the versions see the gradle.properties file
2223 minecraft " com.mojang:minecraft:${ project.minecraft_version} "
2324 mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
24- modCompile " net.fabricmc:fabric-loader:${ project.loader_version} "
25+ modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
2526
26- modCompile " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
27+ modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
2728
28- modImplementation (" io.github.prospector:modmenu:${ project.mod_menu_version} " ){
29- exclude module : " fabric-api"
30- }
29+ modImplementation (" com.terraformersmc:modmenu:${ project.mod_menu_version} " )
3130}
3231
3332processResources {
3433 inputs. property " version" , project. version
3534
36- from(sourceSets. main. resources. srcDirs) {
37- include " fabric.mod.json"
35+ filesMatching(" fabric.mod.json" ) {
3836 expand " version" : project. version
3937 }
40-
41- from(sourceSets. main. resources. srcDirs) {
42- exclude " fabric.mod.json"
43- }
4438}
4539
46- // ensure that the encoding is set to UTF-8, no matter what the system default is
47- // this fixes some edge cases with special characters not displaying correctly
48- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
49- tasks. withType(JavaCompile ) {
50- options. encoding = " UTF-8"
40+ tasks. withType(JavaCompile ). configureEach {
41+ // ensure that the encoding is set to UTF-8, no matter what the system default is
42+ // this fixes some edge cases with special characters not displaying correctly
43+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
44+ // If Javadoc is generated, this must be specified in that task too.
45+ it. options. encoding = " UTF-8"
46+
47+ // Minecraft 1.17 (21w19a) upwards uses Java 16.
48+ it. options. release = 16
5149}
5250
53- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
54- // if it is present.
55- // If you remove this task, sources will not be generated.
56- task sourcesJar (type : Jar , dependsOn : classes) {
57- classifier = " sources"
58- from sourceSets. main. allSource
51+ java {
52+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
53+ // if it is present.
54+ // If you remove this line, sources will not be generated.
55+ withSourcesJar()
5956}
6057
6158jar {
62- from " LICENSE"
59+ from(" LICENSE" ) {
60+ rename { " ${ it} _${ project.archivesBaseName} " }
61+ }
6362}
6463
6564// configure the maven publication
@@ -76,9 +75,11 @@ publishing {
7675 }
7776 }
7877
79- // select the repositories you want to publish to
78+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
8079 repositories {
81- // uncomment to publish to the local maven
82- // mavenLocal()
80+ // Add repositories to publish to here.
81+ // Notice: This block does NOT have the same function as the block in the top level.
82+ // The repositories here will be used for publishing your artifact, not for
83+ // retrieving dependencies.
8384 }
8485}
0 commit comments