Fix issue with manifest util in tests
This commit is contained in:
@@ -73,7 +73,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ */
|
+ */
|
||||||
+ @NotNull
|
+ @NotNull
|
||||||
+ public static String getVersionMessage() {
|
+ 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 gitBranch = manifest.getMainAttributes().getValue("Git-Branch");
|
||||||
+ final String gitCommit = manifest.getMainAttributes().getValue("Git-Commit");
|
+ final String gitCommit = manifest.getMainAttributes().getValue("Git-Commit");
|
||||||
+ String branchMsg = " on " + gitBranch;
|
+ String branchMsg = " on " + gitBranch;
|
||||||
|
|||||||
Reference in New Issue
Block a user