From 4cf1f0d22ab4a067b6d45430e223c158e5242e16 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 27 Nov 2021 00:30:51 -0800 Subject: [PATCH] Fix issue with manifest util in tests --- ...Add-Git-information-to-version-command-on-startup.patch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/patches/api/Add-Git-information-to-version-command-on-startup.patch b/patches/api/Add-Git-information-to-version-command-on-startup.patch index 93399d8d18..0d6b6a7d5b 100644 --- a/patches/api/Add-Git-information-to-version-command-on-startup.patch +++ b/patches/api/Add-Git-information-to-version-command-on-startup.patch @@ -73,7 +73,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + @NotNull + public static String getVersionMessage() { -+ final var manifest = JarManifests.manifest(Bukkit.getServer().getClass()); ++ final java.util.jar.Manifest manifest; ++ if (java.lang.reflect.Proxy.isProxyClass(Bukkit.getServer().getClass())) { // TestServer ++ manifest = new java.util.jar.Manifest(); ++ } else { ++ manifest = JarManifests.manifest(Bukkit.getServer().getClass()); ++ } + final String gitBranch = manifest.getMainAttributes().getValue("Git-Branch"); + final String gitCommit = manifest.getMainAttributes().getValue("Git-Commit"); + String branchMsg = " on " + gitBranch;