fix(carry): support Purpur 26.3 #1

Merged
dmg merged 1 commits from ticket-404-support-purpur-26-3 into main 2026-10-17 00:18:43 +00:00
4 changed files with 31 additions and 13 deletions

No files matched your search

+2 -2
View File
@@ -1,10 +1,10 @@
# Purpur Carry
Purpur Carry is a Purpur 26.2 plugin for native animal and Villager carrying on SoMC. The approved behavior is specified in the [SoMC OKF wiki](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/purpur-carry/index.md).
Purpur Carry is a Purpur 26.3 plugin for native animal and Villager carrying on SoMC. The approved behavior is specified in the [SoMC OKF wiki](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/purpur-carry/index.md).
## Requirements
- Purpur 26.2 build 2618
- Purpur 26.3 build 2651
- Java 25 or newer
- Node.js 20 or newer for release-tool verification
+7 -7
View File
@@ -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")
@@ -55,20 +55,20 @@ tasks.check { dependsOn(releaseToolCheck) }
// Exercise actual Purpur event dispatch and command registration without starting a server.
val carryRuntime = layout.buildDirectory.dir("carry-runtime")
val downloadCarryRuntime = tasks.register("downloadCarryRuntime") {
val launcher = carryRuntime.map { it.file("purpur-26.2-2618.jar") }
val launcher = carryRuntime.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")
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)
}
@@ -76,7 +76,7 @@ val downloadCarryRuntime = tasks.register("downloadCarryRuntime") {
val prepareCarryRuntime = tasks.register<JavaExec>("prepareCarryRuntime") {
dependsOn(downloadCarryRuntime)
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(25) }
classpath = files(carryRuntime.map { it.file("purpur-26.2-2618.jar") })
classpath = files(carryRuntime.map { it.file("purpur-26.3-2651.jar") })
mainClass = "io.papermc.paperclip.Main"
jvmArgs("-Dpaperclip.patchonly=true")
workingDir(carryRuntime)
@@ -46,7 +46,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/** Actual Purpur 2618 listener discovery and event dispatch with entity boundaries doubled. */
/** Actual Purpur 2651 listener discovery and event dispatch with entity boundaries doubled. */
class NativeCarryRoutingTest {
private static Server previousServer;
private PluginManager events;
@@ -8,6 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.DataInputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.jar.JarFile;
import org.bukkit.plugin.java.JavaPlugin;
@@ -48,9 +49,18 @@ final class PurpurCarryDistributionTest {
input.readUnsignedShort();
assertEquals(69, input.readUnsignedShort());
}
List<String> forbiddenPrefixes = List.of(
"com/comphenix/protocol/",
"com/destroystokyo/paper/",
"io/papermc/",
"net/minecraft/",
"org/bukkit/",
"org/purpurmc/",
"org/spigotmc/",
"mockito-extensions/"
);
assertFalse(jar.stream().anyMatch(entry ->
entry.getName().startsWith("org/bukkit/")
|| entry.getName().startsWith("org/purpurmc/")
forbiddenPrefixes.stream().anyMatch(entry.getName()::startsWith)
|| entry.getName().endsWith("Test.class")));
}
}
@@ -62,8 +72,16 @@ final class PurpurCarryDistributionTest {
assertTrue(build.contains("nativeCarryTest"));
assertTrue(build.contains("tasks.check { dependsOn(nativeCarryTest) }"));
assertTrue(build.contains("purpur-api:26.3.build.2651-stable"));
assertTrue(build.contains("purpur-26.3-2651.jar"));
assertTrue(build.contains("https://api.purpurmc.org/v2/purpur/26.3/2651/download"));
assertTrue(build.contains(
"4a32d046a118804d89ca74ba89b798c98f6d8d1f310c18077ac573597049de31"));
"0677c1febecfbc2e5b0a7f76abd647b70a1f38d3cbdf3dd6a82e401b4262a598"));
assertFalse(build.contains("26.2"));
assertFalse(build.contains("2618"));
assertTrue(readme.contains("Purpur 26.3 build 2651"));
assertFalse(readme.contains("Purpur 26.2"));
assertFalse(readme.contains("2618"));
assertTrue(readme.contains("checksum-pinned Purpur event/command suite"));
assertTrue(readme.contains("patch-only mode"));
}