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
1111group = project. maven_group
1212
1313repositories {
14- maven { url ' https://jitpack.io' }
15- }
16-
17- minecraft {
18- accessWidener = file(" src/main/resources/dimthread.accesswidener" )
14+ maven {
15+ url " https://jitpack.io"
16+ }
17+ // Add repositories to retrieve artifacts from in here.
18+ // You should only use this when depending on other mods because
19+ // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
20+ // See https://docs.gradle.org/current/userguide/declaring_repositories.html
21+ // for more information about repositories.
1922}
2023
2124dependencies {
22- implementation ' com.github.WearBlackAllDay:JavaUtils:ab1e0ad736be1d2c2d74c68fa8e9e40e752f2d18'
23- include ' com.github.WearBlackAllDay:JavaUtils:ab1e0ad736be1d2c2d74c68fa8e9e40e752f2d18'
24- // to change the versions see the gradle.properties file
25- minecraft " com.mojang:minecraft:1.16.5"
26- mappings " net.fabricmc:yarn:1.16.5+build.6:v2"
27- modImplementation " net.fabricmc:fabric-loader:0.11.3"
25+ implementation " com.github.wearblackallday:JavaUtils:1b369d41cd"
26+ include" com.github.wearblackallday:JavaUtils:1b369d41cd"
27+
28+ // To change the versions see the gradle.properties file
29+ minecraft " com.mojang:minecraft:${ project.minecraft_version} "
30+ mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
31+ modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
2832
29- // Fabric api
30- // modImplementation "net.fabricmc.fabric-api:fabric-api:0.32.5+1.16 "
31- modCompile " net.fabricmc.fabric-api:fabric-game-rule-api-v1:${ project.fabric_game_rule_v1_version} "
33+ // Fabric API. This is technically optional, but you probably want it anyway.
34+ // modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version} "
35+ modImplementation " net.fabricmc.fabric-api:fabric-game-rule-api-v1:${ project.fabric_game_rule_v1_version} "
3236
3337 // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
3438 // You may need to force-disable transitiveness on them.
39+ }
3540
41+ minecraft {
42+ accessWidener = file(" src/main/resources/dimthread.accesswidener" )
43+ refmapName = " dimthread.refmap.json"
3644}
3745
3846processResources {
3947 inputs. property " version" , project. version
4048
41- from(sourceSets. main. resources. srcDirs) {
42- include " fabric.mod.json"
49+ filesMatching(" fabric.mod.json" ) {
4350 expand " version" : project. version
4451 }
45-
46- from(sourceSets. main. resources. srcDirs) {
47- exclude " fabric.mod.json"
48- }
4952}
5053
51- // ensure that the encoding is set to UTF-8, no matter what the system default is
52- // this fixes some edge cases with special characters not displaying correctly
53- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
54- tasks. withType(JavaCompile ) {
55- options. encoding = " UTF-8"
54+ tasks. withType(JavaCompile ). configureEach {
55+ // ensure that the encoding is set to UTF-8, no matter what the system default is
56+ // this fixes some edge cases with special characters not displaying correctly
57+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
58+ // If Javadoc is generated, this must be specified in that task too.
59+ it. options. encoding = " UTF-8"
60+
61+ // Minecraft 1.17 (21w19a) upwards uses Java 16.
62+ it. options. release = 16
5663}
5764
58- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
59- // if it is present.
60- // If you remove this task, sources will not be generated.
61- task sourcesJar (type : Jar , dependsOn : classes) {
62- classifier = " sources"
63- from sourceSets. main. allSource
65+ java {
66+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
67+ // if it is present.
68+ // If you remove this line, sources will not be generated.
69+ withSourcesJar()
6470}
6571
6672jar {
67- from " LICENSE"
73+ from(" LICENSE" ) {
74+ rename { " ${ it} _${ project.archivesBaseName} " }
75+ }
6876}
6977
7078// configure the maven publication
@@ -81,9 +89,11 @@ publishing {
8189 }
8290 }
8391
84- // select the repositories you want to publish to
92+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
8593 repositories {
86- // uncomment to publish to the local maven
87- // mavenLocal()
94+ // Add repositories to publish to here.
95+ // Notice: This block does NOT have the same function as the block in the top level.
96+ // The repositories here will be used for publishing your artifact, not for
97+ // retrieving dependencies.
8898 }
89- }
99+ }
0 commit comments