A Minecraft Fabric mod that connects the game with ATProtocol ⛏️
1plugins {
2 id 'net.fabricmc.fabric-loom-remap' version "${loom_version}"
3 id 'maven-publish'
4 id "org.jetbrains.kotlin.jvm" version "2.3.0"
5 id "org.jetbrains.kotlin.plugin.serialization" version "2.3.0"
6}
7
8version = project.mod_version
9group = project.maven_group
10
11base {
12 archivesName = project.archives_base_name
13}
14
15repositories {
16 // Add repositories to retrieve artifacts from in here.
17 // You should only use this when depending on other mods because
18 // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
19 // See https://docs.gradle.org/current/userguide/declaring_repositories.html
20 // for more information about repositories.
21
22 // Modrinth Maven for Mod Menu
23 maven {
24 name = "Modrinth"
25 url = "https://api.modrinth.com/maven"
26 }
27}
28
29loom {
30 splitEnvironmentSourceSets()
31
32 mods {
33 "atproto-connect" {
34 sourceSet sourceSets.main
35 sourceSet sourceSets.client
36 }
37 }
38}
39
40dependencies {
41 // To change the versions see the gradle.properties file
42 minecraft "com.mojang:minecraft:${project.minecraft_version}"
43 mappings loom.officialMojangMappings()
44 modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
45
46 // Fabric API. This is technically optional, but you probably want it anyway.
47 modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
48 modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
49
50 // Mod Menu for configuration UI (from Modrinth)
51 modImplementation "maven.modrinth:modmenu:11.0.3"
52
53 // Kotlinx serialization
54 implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3"
55}
56
57processResources {
58 inputs.property "version", project.version
59
60 filesMatching("fabric.mod.json") {
61 expand "version": inputs.properties.version
62 }
63}
64
65tasks.withType(JavaCompile).configureEach {
66 it.options.release = 21
67}
68
69tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
70 kotlinOptions {
71 jvmTarget = 21
72 }
73}
74
75java {
76 // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
77 // if it is present.
78 // If you remove this line, sources will not be generated.
79 withSourcesJar()
80
81 sourceCompatibility = JavaVersion.VERSION_21
82 targetCompatibility = JavaVersion.VERSION_21
83}
84
85jar {
86 inputs.property "archivesName", project.base.archivesName
87
88 from("LICENSE") {
89 rename { "${it}_${inputs.properties.archivesName}"}
90 }
91}
92
93// configure the maven publication
94publishing {
95 publications {
96 create("mavenJava", MavenPublication) {
97 artifactId = project.archives_base_name
98 from components.java
99 }
100 }
101
102 // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
103 repositories {
104 // Add repositories to publish to here.
105 // Notice: This block does NOT have the same function as the block in the top level.
106 // The repositories here will be used for publishing your artifact, not for
107 // retrieving dependencies.
108 }
109}