return false;
}
private static void monkeyPatch() {
if (LSDUtil.isClassLoaded(MODDIRECTORY_CLASS_NAME)) {
throw new LSDInternalException("internal error, " + MODDIRECTORY_CLASS_NAME + " already loaded");
}
// Force ModDirectory class load and monkey patch ModDirectory.DIRECTORY.
File origDir = LSDModDirectory.DIRECTORY;
Field field;
try {
field = LSDModDirectory.class.getDeclaredField(MODDIRECTORY_FIELD_NAME);
} catch (Exception e) {
throw new LSDInternalReflectionException("unable to get field named " + MODDIRECTORY_FIELD_NAME, e);
}
LSDUtil.setFinalField(field, null, testMinecraftDirectory);
println("monkey patched directory field from:\n " + origDir + "\nto:\n " + testMinecraftDirectory);
if (!LSDModDirectory.class.getName().equals(MODDIRECTORY_CLASS_NAME)
|| !LSDUtil.isClassLoaded(MODDIRECTORY_CLASS_NAME)
|| !LSDModDirectory.DIRECTORY.equals(testMinecraftDirectory)) {
throw new LSDInternalException("internal error, sanity check failed");
}
disableUpdateCheck();
}