1
1
plugins {
2
- id ' fabric-loom' version ' 1.1-SNAPSHOT'
3
- id ' maven-publish'
2
+ id ' fabric-loom' version ' 1.2-SNAPSHOT'
4
3
}
5
4
6
5
version = project. mod_version
7
6
group = project. maven_group
8
7
8
+ base {
9
+ archivesName = project. archives_base_name
10
+ }
11
+
12
+ repositories {
13
+ // To use SML, you need to add the FelNullMaven repository
14
+ maven {
15
+ name = " FelNull Maven"
16
+ url = " https://maven.felnull.dev"
17
+ }
18
+ }
19
+
9
20
sourceSets {
10
21
main {
11
22
resources {
@@ -17,6 +28,15 @@ sourceSets {
17
28
}
18
29
19
30
loom {
31
+ splitEnvironmentSourceSets()
32
+
33
+ mods {
34
+ " sml-example-mod" {
35
+ sourceSet sourceSets. main
36
+ sourceSet sourceSets. client
37
+ }
38
+ }
39
+
20
40
runs {
21
41
datagen {
22
42
server()
@@ -31,42 +51,18 @@ loom {
31
51
}
32
52
assemble. dependsOn runDatagen
33
53
34
- repositories {
35
- // Add repositories to retrieve artifacts from in here.
36
- // You should only use this when depending on other mods because
37
- // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
38
- // See https://docs.gradle.org/current/userguide/declaring_repositories.html
39
- // for more information about repositories.
40
-
41
- maven {
42
- name = " FelNull Maven"
43
- url = " https://maven.felnull.dev"
44
- }
45
- }
46
-
47
54
dependencies {
48
- // To change the versions see the gradle.properties file
49
55
minecraft " com.mojang:minecraft:${ project.minecraft_version} "
50
- /* mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"*/
51
56
mappings loom. officialMojangMappings()
52
57
modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
53
58
54
- // Fabric API. This is technically optional, but you probably want it anyway.
55
59
modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
56
60
57
- modApi " dev.felnull:special-model-loader:1.1.0"
58
-
59
- // ↓ Required for inclusion in jar in jar
60
- include " dev.felnull:special-model-loader:1.0.0"
61
-
62
- // Uncomment the following line to enable the deprecated Fabric API modules.
63
- // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
64
-
65
- // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
66
- }
61
+ // Using the SML API
62
+ modApi " dev.felnull:special-model-loader:1.2.0"
67
63
68
- base {
69
- archivesName = project . archives_base_name
64
+ // Required for inclusion in jar in jar
65
+ include " dev.felnull:special-model-loader:1.2.0 "
70
66
}
71
67
72
68
processResources {
@@ -78,14 +74,10 @@ processResources {
78
74
}
79
75
80
76
tasks. withType(JavaCompile ). configureEach {
81
- // Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
82
77
it. options. release = 17
83
78
}
84
79
85
80
java {
86
- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
87
- // if it is present.
88
- // If you remove this line, sources will not be generated.
89
81
withSourcesJar()
90
82
91
83
sourceCompatibility = JavaVersion . VERSION_17
@@ -94,23 +86,6 @@ java {
94
86
95
87
jar {
96
88
from(" LICENSE" ) {
97
- rename { " ${ it} _${ base.archivesName.get() } " }
89
+ rename { " ${ it} _${ project.archivesBaseName } " }
98
90
}
99
- }
100
-
101
- // configure the maven publication
102
- publishing {
103
- publications {
104
- mavenJava(MavenPublication ) {
105
- from components. java
106
- }
107
- }
108
-
109
- // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
110
- repositories {
111
- // Add repositories to publish to here.
112
- // Notice: This block does NOT have the same function as the block in the top level.
113
- // The repositories here will be used for publishing your artifact, not for
114
- // retrieving dependencies.
115
- }
116
- }
91
+ }
0 commit comments