Skip to content

Commit

Permalink
checkClassLoading no longer runs repeatedly
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed Mar 4, 2016
1 parent 521b813 commit bd87746
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/me/nallar/modpatcher/ModPatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class ModPatcher {
private static Future<Boolean> updateRequired = defaultUpdateRequired;
private static Version requiredVersion;
private static Version lastVersion;
private static boolean checked = false;

static {
requireVersionInternal(null, null);
Expand Down Expand Up @@ -275,9 +276,13 @@ private static void checkClassLoading() {
}

private static void checkClassLoading(boolean load) {
if (checked)
return;

try {
Class.forName(MODPATCHER_PACKAGE + ".ModPatcherLoadHook");
ModPatcherLoadHook.loadHook(requiredVersion, getModPatcherRelease(), API_VERSION);
checked = true;
} catch (ClassNotFoundException | NoClassDefFoundError e) {
if (!load)
throw new Error(e);
Expand Down

0 comments on commit bd87746

Please sign in to comment.