3c261db111
- build.gradle: add javazoom:jlayer:1.0.1 dependency (bundled via include()) - Mp3Decoder: new utility class that decodes MP3 to WAV using JLayer - SplashSound: detect .mp3 files in config dir, decode to .wav for the dynamic resource pack - Default .ogg still works; place a .mp3 file in config/justasplash/ for MP3 playback
62 lines
1.6 KiB
Groovy
62 lines
1.6 KiB
Groovy
plugins {
|
|
id "fabric-loom" version "1.9.1"
|
|
id "maven-publish"
|
|
}
|
|
|
|
def mcVersion = project.findProperty("mcVersion") ?: "1.21.1"
|
|
|
|
def ver = [
|
|
"1.20.1": [mappings: "1.20.1+build.10", loader: "0.15.11", fabricApi: "0.92.0+1.20.1"],
|
|
"1.21": [mappings: "1.21+build.8", loader: "0.15.11", fabricApi: "0.100.0+1.21"],
|
|
"1.21.1": [mappings: "1.21.1+build.3", loader: "0.15.11", fabricApi: "0.101.2+1.21.1"],
|
|
]
|
|
|
|
def v = ver[mcVersion]
|
|
if (v == null) throw new GradleException("Unsupported MC version: $mcVersion")
|
|
|
|
version = "${project.findProperty("modVersion") ?: "1.0.0"}+mc${mcVersion}"
|
|
group = project.findProperty("mavenGroup") ?: "net.anomaly"
|
|
|
|
base {
|
|
archivesName = "JustASplash"
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url "https://maven.fabricmc.net/" }
|
|
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "com.mojang:minecraft:${mcVersion}"
|
|
mappings "net.fabricmc:yarn:${v.mappings}:v2"
|
|
modImplementation "net.fabricmc:fabric-loader:${v.loader}"
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${v.fabricApi}"
|
|
|
|
modImplementation("com.github.usefulness:webp-imageio:0.10.2")
|
|
include("com.github.usefulness:webp-imageio:0.10.2")
|
|
|
|
modImplementation("javazoom:jlayer:1.0.1")
|
|
include("javazoom:jlayer:1.0.1")
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath = file("src/main/resources/justasplash.accesswidener")
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
it.options.release = 17
|
|
}
|