enable built mod file renaming, remove mixin AP since we don't need it

because there's no need to remap mixins in any way as we run the game in mojmap as well
This commit is contained in:
moehreag 2024-05-25 15:45:29 +02:00
parent 17c4cf3a56
commit 61cfc68ddd
2 changed files with 7 additions and 13 deletions

View file

@ -15,7 +15,9 @@ import org.jetbrains.java.decompiler.main.decompiler.SingleFileSaver
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences
import java.io.PrintStream import java.io.PrintStream
import java.net.URI import java.net.URI
import java.nio.file.Files
import java.nio.file.Path import java.nio.file.Path
import java.nio.file.StandardCopyOption
import kotlin.io.path.createDirectories import kotlin.io.path.createDirectories
import kotlin.io.path.deleteExisting import kotlin.io.path.deleteExisting
import kotlin.io.path.exists import kotlin.io.path.exists
@ -44,10 +46,6 @@ class NonsenseGradlePlugin : Plugin<Project> {
it.name = "Esnesnon Snapshots" it.name = "Esnesnon Snapshots"
it.url = URI.create("https://maven-esnesnon.ecorous.org/snapshots") it.url = URI.create("https://maven-esnesnon.ecorous.org/snapshots")
} }
maven {
it.name = "FabricMC"
it.url = URI.create("https://maven.fabricmc.net")
}
maven { maven {
it.name = "Minecraft/Local" it.name = "Minecraft/Local"
it.url = project.gradle.gradleUserHomeDir.resolve("caches/nonsense-gradle/").toURI() it.url = project.gradle.gradleUserHomeDir.resolve("caches/nonsense-gradle/").toURI()
@ -119,22 +117,21 @@ class NonsenseGradlePlugin : Plugin<Project> {
} }
} }
// TODO mod relocation/renaming: decide on mod file extension project.tasks.getByName("jar").actions.addLast {
/*project.tasks.getByName("jar").actions.addLast {
it.outputs.files.forEach {file -> it.outputs.files.forEach {file ->
val output = file.toPath().parent.resolveSibling("nonsense-mods") val output = file.toPath().parent.resolveSibling("frog")
output.createDirectories() output.createDirectories()
if (file.name.endsWith(".jar") && !(file.name.contains("-dev.") || file.name.contains("-sources."))){ if (file.name.endsWith(".jar") && !(file.name.contains("-dev.") || file.name.contains("-sources."))){
Files.copy(file.toPath(), output.resolve(file.name.substring(0, file.name.length-4)+".nonsense")) Files.copy(file.toPath(), output.resolve(file.name.substring(0, file.name.length-4)+".frogmod"), StandardCopyOption.REPLACE_EXISTING)
}
} }
} }
}*/
val includeConfiguration = project.configurations.create("include").apply { val includeConfiguration = project.configurations.create("include").apply {
extendsFrom(project.configurations.getByName("implementation")) extendsFrom(project.configurations.getByName("implementation"))
} }
project.tasks.getByName("jar").actions.addLast { project.tasks.getByName("jar") {
it.outputs.files(includeConfiguration.artifacts.files) it.outputs.files(includeConfiguration.artifacts.files)
} }
} }

View file

@ -37,7 +37,6 @@ fun Project.minecraft(
NonsenseRemapper.remap(data, clientJar, remappedJar, true, paramMappings) NonsenseRemapper.remap(data, clientJar, remappedJar, true, paramMappings)
} }
println("Adding dependencies...") println("Adding dependencies...")
//configurations.getByName("development").extendsFrom(configurations.getByName("implementation"))
dependencies.add("implementation","net.minecrell:terminalconsoleappender:1.2.0") dependencies.add("implementation","net.minecrell:terminalconsoleappender:1.2.0")
VersionChecker.getDependencies(version) { VersionChecker.getDependencies(version) {
dependencies.add("implementation", it) dependencies.add("implementation", it)
@ -56,6 +55,4 @@ fun Project.minecraft(
fun Project.loader(version: String){ fun Project.loader(version: String){
dependencies.add("implementation", "org.ecorous.esnesnon:nonsense-loader:$version") dependencies.add("implementation", "org.ecorous.esnesnon:nonsense-loader:$version")
// TODO how can we make this version not have to be hard-coded?
dependencies.add("annotationProcessor", "net.fabricmc:sponge-mixin:0.13.4+mixin.0.8.5")
} }