fix(base): support Purpur 26.3
This commit is contained in:
1 parent
0fe6a14451
commit
5949eff7fd
5 files changed
+41
-19
No files matched your search
+7
-7
@@ -26,9 +26,9 @@ tasks.withType<JavaCompile>().configureEach {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:26.2.build.2618-stable")
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:26.3.build.2651-stable")
|
||||
|
||||
testImplementation("org.purpurmc.purpur:purpur-api:26.2.build.2618-stable")
|
||||
testImplementation("org.purpurmc.purpur:purpur-api:26.3.build.2651-stable")
|
||||
testImplementation(platform("org.junit:junit-bom:5.13.4"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testImplementation("org.mockito:mockito-core:5.18.0")
|
||||
@@ -46,18 +46,18 @@ tasks.test {
|
||||
// Verify client-only label packets against the declared runtime, without starting a server.
|
||||
val labelRuntime = layout.buildDirectory.dir("label-runtime")
|
||||
val downloadLabelRuntime = tasks.register("downloadLabelRuntime") {
|
||||
val launcher = labelRuntime.map { it.file("purpur-26.2-2618.jar") }
|
||||
val launcher = labelRuntime.map { it.file("purpur-26.3-2651.jar") }
|
||||
outputs.file(launcher)
|
||||
doLast {
|
||||
val file = launcher.get().asFile
|
||||
file.parentFile.mkdirs()
|
||||
val connection = URI("https://api.purpurmc.org/v2/purpur/26.2/2618/download").toURL().openConnection()
|
||||
val connection = URI("https://api.purpurmc.org/v2/purpur/26.3/2651/download").toURL().openConnection()
|
||||
connection.connectTimeout = 30_000
|
||||
connection.readTimeout = 120_000
|
||||
val bytes = connection.getInputStream().use { it.readBytes() }
|
||||
val digest = MessageDigest.getInstance("SHA-256").digest(bytes).joinToString("") { "%02x".format(it) }
|
||||
check(digest == "4a32d046a118804d89ca74ba89b798c98f6d8d1f310c18077ac573597049de31") {
|
||||
"Purpur 2618 checksum mismatch"
|
||||
check(digest == "0677c1febecfbc2e5b0a7f76abd647b70a1f38d3cbdf3dd6a82e401b4262a598") {
|
||||
"Purpur 2651 checksum mismatch"
|
||||
}
|
||||
file.writeBytes(bytes)
|
||||
}
|
||||
@@ -65,7 +65,7 @@ val downloadLabelRuntime = tasks.register("downloadLabelRuntime") {
|
||||
val prepareLabelRuntime = tasks.register<JavaExec>("prepareLabelRuntime") {
|
||||
dependsOn(downloadLabelRuntime)
|
||||
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(25) }
|
||||
classpath = files(labelRuntime.map { it.file("purpur-26.2-2618.jar") })
|
||||
classpath = files(labelRuntime.map { it.file("purpur-26.3-2651.jar") })
|
||||
mainClass = "io.papermc.paperclip.Main"
|
||||
jvmArgs("-Dpaperclip.patchonly=true")
|
||||
workingDir(labelRuntime)
|
||||
|
||||
Reference in new issue
Block a user