Skip to content

Commit

Permalink
Further cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Moresteck committed Sep 10, 2024
1 parent ec16147 commit 6c6f5d1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
20 changes: 14 additions & 6 deletions src/main/java/org/betacraft/Classic12aWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,15 @@ public void stop() {
runningField.set(run, false);
}
}
Method real12a = clazz.getDeclaredMethod("a", null);
if (real12a == null) {

Method real12a;
try {
real12a = clazz.getDeclaredMethod("a");
} catch (NoSuchMethodException noSuchMethodException) {
// 12a-dev
real12a = clazz.getDeclaredMethod("stop", null);
real12a = clazz.getDeclaredMethod("stop");
}

real12a.invoke(run);
}
}
Expand All @@ -188,11 +192,15 @@ public void destroy() {
if (name.contains("mojang")) {
final Class<?> clazz = classLoader.loadClass(name);
mcField.setAccessible(true);
Method real12a = clazz.getDeclaredMethod("a", null);
if (real12a == null) {

Method real12a;
try {
real12a = clazz.getDeclaredMethod("a");
} catch (NoSuchMethodException noSuchMethodException) {
// 12a-dev
real12a = clazz.getDeclaredMethod("destroy", null);
real12a = clazz.getDeclaredMethod("destroy");
}

real12a.invoke(run);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/Classic15aWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void stop() {
runningField.set(run, false);
}
}
clazz.getDeclaredMethod("b", null).invoke(run);
clazz.getDeclaredMethod("b").invoke(run);
}
}
} catch (Exception ex) {
Expand All @@ -185,7 +185,7 @@ public void destroy() {
if (name.contains("mojang")) {
final Class<?> clazz = classLoader.loadClass(name);
mcField.setAccessible(true);
clazz.getDeclaredMethod("a", null).invoke(run);
clazz.getDeclaredMethod("a").invoke(run);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/betacraft/launcher/BC.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BC {
public static PropertyFile SETTINGS;

// TODO better check this before release
public static boolean prerelease = true;
public static boolean prerelease = false;
public static boolean nightly = false;

public static boolean portable = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/betacraft/launcher/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/** Main class */
public class Launcher {
public static String VERSION = "1.09_17-rc3"; // TODO Always update this
public static String VERSION = "1.09_17"; // TODO Always update this

public static Instance currentInstance;
public static boolean forceUpdate = false;
Expand Down

0 comments on commit 6c6f5d1

Please sign in to comment.