|
| 1 | +plugins { |
| 2 | + id("fabric-loom") version "1.14-SNAPSHOT" |
| 3 | +} |
| 4 | + |
| 5 | +java.toolchain.languageVersion.set(JavaLanguageVersion.of(21)) |
| 6 | + |
| 7 | +val minecraftVersion = "1.21.11" |
| 8 | +val yarnMappings = "1.21.11+build.3" |
| 9 | +val loaderVersion = "0.18.2" |
| 10 | +val fabricVersion = "0.139.5+1.21.11" |
| 11 | +val archivesBaseName = "InterChatMod-${project.name}" |
| 12 | +val adventureVersion by project.properties |
| 13 | + |
| 14 | +repositories { |
| 15 | + mavenCentral() |
| 16 | + maven { url = uri("https://maven.shedaniel.me/") } |
| 17 | + maven { url = uri("https://maven.terraformersmc.com/releases/") } |
| 18 | +} |
| 19 | + |
| 20 | +dependencies { |
| 21 | + // To change the versions see the gradle.properties file |
| 22 | + minecraft("com.mojang:minecraft:$minecraftVersion") |
| 23 | + mappings("net.fabricmc:yarn:$yarnMappings:v2") |
| 24 | + modImplementation("net.fabricmc:fabric-loader:$loaderVersion") |
| 25 | + |
| 26 | + // Fabric API. This is technically optional, but you probably want it anyway. |
| 27 | + modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion") |
| 28 | + |
| 29 | + modApi("me.shedaniel.cloth:cloth-config-fabric:19.0.147") { |
| 30 | + exclude("net.fabricmc.fabric-api") |
| 31 | + } |
| 32 | + modApi("com.terraformersmc:modmenu:15.0.0") |
| 33 | + |
| 34 | + // Uncomment the following line to enable the deprecated Fabric API modules. |
| 35 | + // 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. |
| 36 | + |
| 37 | + // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" |
| 38 | + implementation(project(":common")) |
| 39 | + include(project(":common")) |
| 40 | + include("net.kyori:adventure-api:$adventureVersion") |
| 41 | + include("net.kyori:adventure-key:$adventureVersion") |
| 42 | + include("net.kyori:examination-api:1.3.0") |
| 43 | + include("net.kyori:examination-string:1.3.0") |
| 44 | + include("net.kyori:adventure-text-serializer-legacy:$adventureVersion") |
| 45 | + include("net.kyori:adventure-text-serializer-json:$adventureVersion") |
| 46 | + include("net.kyori:adventure-text-serializer-gson:$adventureVersion") |
| 47 | + include("org.java-websocket:Java-WebSocket:1.5.4") |
| 48 | + include("de.marhali:json5-java:3.0.0") |
| 49 | +} |
| 50 | + |
| 51 | +tasks { |
| 52 | + processResources { |
| 53 | + inputs.property("version", project.version) |
| 54 | + |
| 55 | + filesMatching("fabric.mod.json") { |
| 56 | + expand(mapOf("version" to project.version)) |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + compileJava { |
| 61 | + options.encoding = "UTF-8" |
| 62 | + } |
| 63 | + |
| 64 | + remapJar { |
| 65 | + archiveFileName.set("$archivesBaseName-${project.version}.jar") |
| 66 | + from("LICENSE") { |
| 67 | + rename { "${it}_${archivesBaseName}"} |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + remapSourcesJar { |
| 72 | + archiveFileName.set("$archivesBaseName-${project.version}-sources.jar") |
| 73 | + from("LICENSE") { |
| 74 | + rename { "${it}_${archivesBaseName}"} |
| 75 | + } |
| 76 | + } |
| 77 | + |
| 78 | + shadowJar { |
| 79 | + archiveBaseName.set("$archivesBaseName-DO-NOT-USE") |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +java { |
| 84 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 85 | + // if it is present. |
| 86 | + // If you remove this line, sources will not be generated. |
| 87 | + withSourcesJar() |
| 88 | +} |
0 commit comments