Skip to content

Commit

Permalink
Feat: add MioLibFixer for clean log
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirosakiMio committed Dec 1, 2024
1 parent d7e3382 commit 23b40d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions FCL/src/main/java/com/tungsten/fcl/game/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ private void launch0() {
);
}).withStage("launch.state.dependencies")
.thenComposeAsync(() -> {
if (!new File(FCLPath.MULTIPLAYER_FIX_PATH).exists()) {
try (InputStream input = LauncherHelper.class.getResourceAsStream("/assets/game/MultiplayerFix.jar")) {
Files.copy(input, new File(FCLPath.MULTIPLAYER_FIX_PATH).toPath(), StandardCopyOption.REPLACE_EXISTING);
if (!new File(FCLPath.LIB_FIXER_PATH).exists()) {
try (InputStream input = LauncherHelper.class.getResourceAsStream("/assets/game/MioLibFixer.jar")) {
Files.copy(input, new File(FCLPath.LIB_FIXER_PATH).toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
Logging.LOG.log(Level.WARNING, "Unable to unpack MultiplayerFix.jar", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ private CommandBuilder generateCommandLine() throws IOException {
}

// Fix 1.16.x multiplayer
if (repository.getGameVersion(version).isPresent() && repository.getGameVersion(version).get().startsWith("1.16")) {
res.add("-javaagent:" + FCLPath.MULTIPLAYER_FIX_PATH);
}
// if (repository.getGameVersion(version).isPresent() && repository.getGameVersion(version).get().startsWith("1.16")) {
//
// }
res.add("-javaagent:" + FCLPath.LIB_FIXER_PATH);

Set<String> classpath = repository.getClasspath(version);
classpath.add(FCLPath.MIO_LAUNCH_WRAPPER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class FCLPath {
public static String SHARED_COMMON_DIR = Environment.getExternalStorageDirectory().getAbsolutePath() + "/FCL/.minecraft";

public static String AUTHLIB_INJECTOR_PATH;
public static String MULTIPLAYER_FIX_PATH;
public static String LIB_FIXER_PATH;
public static String MIO_LAUNCH_WRAPPER;
public static String LT_BACKGROUND_PATH;
public static String DK_BACKGROUND_PATH;
Expand Down Expand Up @@ -66,7 +66,7 @@ public static void loadPaths(Context context) {
PRIVATE_COMMON_DIR = context.getExternalFilesDir(".minecraft").getAbsolutePath();

AUTHLIB_INJECTOR_PATH = PLUGIN_DIR + "/authlib-injector.jar";
MULTIPLAYER_FIX_PATH = PLUGIN_DIR + "/MultiplayerFix.jar";
LIB_FIXER_PATH = PLUGIN_DIR + "/MioLibFixer.jar";
MIO_LAUNCH_WRAPPER = PLUGIN_DIR + "/MioLaunchWrapper.jar";
LT_BACKGROUND_PATH = BACKGROUND_DIR + "/lt.png";
DK_BACKGROUND_PATH = BACKGROUND_DIR + "/dk.png";
Expand Down

0 comments on commit 23b40d3

Please sign in to comment.