Skip to content

Commit 882f6f0

Browse files
committed
修复不能启动的问题
1 parent affe345 commit 882f6f0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ tasks.withType<ShadowJar> {
3636
manifest {
3737
attributes("Version" to archiveVersion.get())
3838
attributes("Git-Commit" to (gitCommitSha ?: ""))
39-
attributes("Main-Class" to "com.github.balloonupdate.mcpatch.client")
40-
attributes("Premain-Class" to "com.github.balloonupdate.mcpatch.client")
39+
attributes("Main-Class" to "com.github.balloonupdate.mcpatch.client.Main")
40+
attributes("Premain-Class" to "com.github.balloonupdate.mcpatch.client.Main")
4141
}
4242

4343
archiveClassifier.set("")

src/main/java/com/github/balloonupdate/mcpatch/client/utils/Env.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public static Path getJarPath()
5959
try {
6060
String url = URLDecoder.decode(Env.class.getProtectionDomain().getCodeSource().getLocation().getFile(), "UTF-8").replace("\\", "/");
6161

62+
if (url.startsWith("/"))
63+
url = url.substring(1);
64+
6265
if (url.endsWith(".class") && url.contains("!")) {
6366
String path = url.substring(0, url.lastIndexOf("!"));
6467

0 commit comments

Comments
 (0)