Skip to content

Commit

Permalink
Update workspace, integrate ModMenu, ClothConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ChloeDawn committed Jun 23, 2022
1 parent 6a0f8c5 commit f49914c
Show file tree
Hide file tree
Showing 13 changed files with 575 additions and 350 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Armor Sound Tweak
A mod for Minecraft that plays the respective equip sound when (un)equipping armor in a menu
A mod for Minecraft that plays the respective equip sound when (un)equipping armor in a menu.
129 changes: 85 additions & 44 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import java.time.Instant

plugins {
id("fabric-loom") version "0.10.64"
id("net.nemerosa.versioning") version "2.15.1"
id("fabric-loom") version "0.12.51"
id("net.nemerosa.versioning") version "3.0.0"
id("signing")
}

Expand All @@ -13,25 +13,69 @@ java {
withSourcesJar()
}

loom {
runs {
configureEach {
vmArgs("-Xmx4G", "-XX:+UseZGC")
}
}
}

repositories {
maven("https://maven.shedaniel.me") {
content {
includeGroup("me.shedaniel.cloth")
}
}

maven("https://maven.terraformersmc.com/releases") {
content {
includeGroup("com.terraformersmc")
}
}
}

dependencies {
minecraft("com.mojang:minecraft:1.18.1")
mappings(loom.officialMojangMappings())
modImplementation("net.fabricmc:fabric-loader:0.12.11")
modImplementation(include(fabricApi.module("fabric-api-base", "0.44.0+1.18"))!!)
modImplementation(include(fabricApi.module("fabric-lifecycle-events-v1", "0.44.0+1.18"))!!)
minecraft("com.mojang:minecraft:1.18.2")
mappings(loom.layered {
officialMojangMappings {
nameSyntheticMembers = true
}
})

modImplementation("net.fabricmc:fabric-loader:0.14.8")

modImplementation(include(fabricApi.module("fabric-api-base", "0.56.1+1.18.2"))!!)
modImplementation(include(fabricApi.module("fabric-lifecycle-events-v1", "0.56.1+1.18.2"))!!)
modImplementation(include(fabricApi.module("fabric-resource-loader-v0", "0.56.1+1.18.2"))!!)

modImplementation(include("me.shedaniel.cloth:cloth-config-fabric:6.2.62") {
exclude(group = "net.fabricmc.fabric-api")
})

modImplementation("com.terraformersmc:modmenu:3.2.2")

implementation(include("com.electronwill.night-config:core:3.6.5")!!)
implementation(include("com.electronwill.night-config:toml:3.6.5")!!)
implementation("org.checkerframework:checker-qual:3.20.0")

implementation("org.checkerframework:checker-qual:3.22.1")
}

tasks {
compileJava {
with(options) {
release.set(17)
isFork = true
isDeprecation = true
encoding = "UTF-8"
compilerArgs.addAll(listOf("-Xlint:all", "-parameters"))
isFork = true
compilerArgs.addAll(
listOf(
"-Xlint:all", "-Xlint:-processing",
// Enable parameter name class metadata
// https://openjdk.java.net/jeps/118
"-parameters"
)
)
release.set(17)
}
}

Expand Down Expand Up @@ -68,48 +112,45 @@ tasks {
)
}

remapJar {
archiveClassifier.set("fabric")
}

with(getByName<Jar>("sourcesJar")) {
archiveClassifier.set("fabric-${archiveClassifier.get()}")
}

if (hasProperty("signing.mods.keyalias")) {
val alias = property("signing.mods.keyalias")
val keystore = property("signing.mods.keystore")
val password = property("signing.mods.password")

listOf(remapJar, remapSourcesJar).forEach {
it.get().doLast {
if (!project.file(keystore!!).exists()) {
error("Missing keystore $keystore")
}

val file = outputs.files.singleFile
ant.invokeMethod(
"signjar", mapOf(
"jar" to file,
"alias" to alias,
"storepass" to password,
"keystore" to keystore,
"verbose" to true,
"preservelastmodified" to true
)
)
signing.sign(file)
fun Sign.antSignJar(task: Task) = task.outputs.files.forEach { file ->
ant.invokeMethod(
"signjar", mapOf(
"jar" to file,
"alias" to alias,
"storepass" to password,
"keystore" to keystore,
"verbose" to true,
"preservelastmodified" to true
))
}

val signJar by creating(Sign::class) {
dependsOn(remapJar)

doFirst {
antSignJar(remapJar.get())
}

sign(remapJar.get())
}
}

assemble {
dependsOn(versionFile, remapJar, remapSourcesJar)
val signSourcesJar by creating(Sign::class) {
dependsOn(remapSourcesJar)

doFirst {
antSignJar(remapSourcesJar.get())
}

sign(remapSourcesJar.get())
}

doFirst {
delete(buildDir.resolve("libs").listFiles { _, name ->
name.endsWith("-dev.jar")
})
assemble {
dependsOn(signJar, signSourcesJar)
}
}
}
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
org.gradle.console = verbose
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8
org.gradle.logging.level = info
org.gradle.parallel = true
org.gradle.warning.mode = all
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=b75392c5625a88bccd58a574552a5a323edca82dab5942d2d41097f809c6bcce
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
distributionSha256Sum=e6d864e3b5bc05cc62041842b306383fc1fefcec359e70cebb1d470a6094ca82
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit f49914c

Please sign in to comment.