Skip to content

Commit

Permalink
Remove Mixin version checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZekerZhayard committed Nov 26, 2020
1 parent 4569be5 commit b46f488
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void initialize(@Nonnull IEnvironment environment) {
// We should check if it is under development environments or loaded required versions successfully.
if (checked = Files.isDirectory(path) || currentFMLVersion.length() == 0) {
// Nothing to do.
} else if (checked = VersionChecker.IS_LOADED && VersionChecker.checkOptiFineVersion(VersionChecker.DEFAULT_FUNCTION, true) && VersionChecker.checkMixinVersion(VersionChecker.DEFAULT_FUNCTION) && VersionChecker.checkForgeVersion(VersionChecker.DEFAULT_FUNCTION, currentFMLVersion.toString())) {
} else if (checked = VersionChecker.IS_LOADED && VersionChecker.checkOptiFineVersion(VersionChecker.DEFAULT_FUNCTION, true) && VersionChecker.checkForgeVersion(VersionChecker.DEFAULT_FUNCTION, currentFMLVersion.toString())) {
// FML can't detect IModLocator when ITransformationService exists in the same jar, so we must add it manually.
ModDirTransformerDiscoverer.getExtraLocators().add(path);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,27 +181,6 @@ public static String getOptiFineVersionFromJar(Path optifine) {
return null;
}

/**
* Mixin has it own version checker system, so this method only check if Mixin exists.
*/
public static boolean checkMixinVersion(Function<String, Boolean> function) {
try {
Class.forName("org.spongepowered.asm.launch.MixinBootstrap").getField("VERSION");
} catch (Exception e) {
StringBuilder message = new StringBuilder(
"It looks like you have not install Mixin, you can download it from https://www.curseforge.com/minecraft/mc-mods/mixinbootstrap.\n" +
"The game will continue, and run without OptiFine and OptiForge.\n\n" +
e + "\n"
);
for (StackTraceElement traceElement : e.getStackTrace()) {
message.append("\tat ").append(traceElement).append("\n");
}
LOGGER.error(message.toString());
return function.apply(message.toString());
}
return true;
}

/**
* FML can't check the build number and if can't match minor version, game won't crash or prompt players prompts
*/
Expand Down

0 comments on commit b46f488

Please sign in to comment.