Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Jul 18, 2024
1 parent c5ccf01 commit 44e2835
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Blueberry-API/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@ tasks {
filter(org.apache.tools.ant.filters.EscapeUnicode::class.java)
}
}

remapJar {
enabled = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BuildPlugin : Plugin<Project> {
project.tasks.register("createServerPatcherJar", BaseBlueberryTask::class.java, CreateServerPatcherJarAction())
project.tasks.register("bakeInstaller", BaseBlueberryTask::class.java, BakeInstallerAction())
project.tasks.register("downloadServerJar", BaseBlueberryTask::class.java, DownloadServerJarAction())
project.tasks.register("downloadClientJar", BaseBlueberryTask::class.java, DownloadClientJarAction())
project.tasks.register("applyBlueberryPatches", ApplyBlueberryPatches::class.java, ApplyBlueberryPatchesAction())
project.tasks.register("applyMinecraftPatches", BaseBlueberryTask::class.java, ApplyMinecraftPatchesAction())
project.tasks.register("rebuildBlueberryPatches", RebuildBlueberryPatches::class.java, RebuildBlueberryPatchesAction())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class CreateClientPatchAction : Action<BaseBlueberryTask> {
val patchFilePath = File(baseDir, "work/jbsdiffPatcher/src/main/resources/patch.bz2")
task.project.getTaskByName("shadowJar", "blueberry")?.let { task.dependsOn(it) }
task.outputs.file(patchFilePath)
task.dependsOn("downloadClientJar")
task.doLast {
val clientJarBytes = File(baseDir, "MagmaCube/work/Minecraft/$MINECRAFT_VERSION/client.jar").readBytes()
val clientJarBytes = File(baseDir, "work/Minecraft/$MINECRAFT_VERSION/client.jar").readBytes()
val patchedClientJarBytes =
task.project.getTaskByName("shadowJar", "blueberry")!!.outputs.files.singleFile.readBytes()
patchFilePath.delete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CreateClientPatcherJarAction : Action<BaseBlueberryTask> {
task.dependsOn("createClientPatch")
task.outputs.file(patcherJar)
task.doLast {
val clientJarBytes = File(baseDir, "MagmaCube/work/Minecraft/$MINECRAFT_VERSION/client.jar").readBytes()
val clientJarBytes = File(baseDir, "work/Minecraft/$MINECRAFT_VERSION/client.jar").readBytes()
val patchedClientJarBytes =
task.project.getTaskByName("shadowJar", "blueberry")!!.outputs.files.singleFile.readBytes()
val vanillaHash = Util.sha256sum(clientJarBytes)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.blueberrymc.gradle.buildSrc.actions

import net.blueberrymc.gradle.buildSrc.Util
import net.blueberrymc.gradle.buildSrc.constants.CLIENT_JAR_URL
import net.blueberrymc.gradle.buildSrc.constants.MINECRAFT_VERSION
import net.blueberrymc.gradle.buildSrc.tasks.BaseBlueberryTask
import org.gradle.api.Action
import java.io.File

class DownloadClientJarAction : Action<BaseBlueberryTask> {
override fun execute(task: BaseBlueberryTask) {
val destination = File(task.project.projectDir, "work/Minecraft/$MINECRAFT_VERSION/client.jar")
task.outputs.file(destination)
task.doLast {
Util.downloadFile(CLIENT_JAR_URL, destination)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ open class PrepareMinecraftAction : Action<BaseBlueberryTask> {
override fun execute(t: BaseBlueberryTask) {
t.doLast {
val minecraftRoot = File(t.project.rootDir, "work/Minecraft")
// setup files
minecraftRoot.mkdirs()
minecraftRoot.resolve("src").let {
if (it.exists()) it.deleteRecursively()
}
minecraftRoot.resolve(".git").let {
if (it.exists()) it.deleteRecursively()
if (minecraftRoot.exists()) {
minecraftRoot.deleteRecursively()
}
files.forEach { file ->
val fileName = file.split("/").last()
Expand Down

0 comments on commit 44e2835

Please sign in to comment.