Skip to content

Commit

Permalink
修复不能启动的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
asforest committed Feb 1, 2025
1 parent affe345 commit 882f6f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ tasks.withType<ShadowJar> {
manifest {
attributes("Version" to archiveVersion.get())
attributes("Git-Commit" to (gitCommitSha ?: ""))
attributes("Main-Class" to "com.github.balloonupdate.mcpatch.client")
attributes("Premain-Class" to "com.github.balloonupdate.mcpatch.client")
attributes("Main-Class" to "com.github.balloonupdate.mcpatch.client.Main")
attributes("Premain-Class" to "com.github.balloonupdate.mcpatch.client.Main")
}

archiveClassifier.set("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public static Path getJarPath()
try {
String url = URLDecoder.decode(Env.class.getProtectionDomain().getCodeSource().getLocation().getFile(), "UTF-8").replace("\\", "/");

if (url.startsWith("/"))
url = url.substring(1);

if (url.endsWith(".class") && url.contains("!")) {
String path = url.substring(0, url.lastIndexOf("!"));

Expand Down

0 comments on commit 882f6f0

Please sign in to comment.