xfl03 / JMCCC

A powerful open-source library for launching and downloading Minecraft.
MIT License
145 stars 31 forks source link

Run Local Versions like OPTIFINE MODS etc #36

Open andfont opened 1 year ago

andfont commented 1 year ago

There is no way to run local mods like optifine or similar, is there a way? example error: java.io.IOException: Couldn't parse version json: 1.19.2-Aristois at org.to2mbn.jmccc.version.parsing.Versions.resolveVersion(Versions.java:44) at org.to2mbn.jmccc.option.LaunchOption.requireVersion(LaunchOption.java:125) at org.to2mbn.jmccc.option.LaunchOption.(LaunchOption.java:101) at launcherabf.menu.ejecutarmc(menu.java:344) at launcherabf.menu$2.actionPerformed(menu.java:103)

public static Version resolveVersion(MinecraftDirectory minecraftDir, String version) throws IOException { Objects.requireNonNull(minecraftDir); Objects.requireNonNull(version);

    if (doesVersionExist(minecraftDir, version)) {
        try {
            return getVersionParser().parseVersion(resolveVersionHierarchy(version, minecraftDir), PlatformDescription.current());
        } catch (JSONException e) {
            throw new IOException("Couldn't parse version json: " + version, e);
        }
    } else {
        return null;
    }
}
8MiYile commented 1 year ago

@xfl03 这都上代码了 你要不来瞅瞅?

andfont commented 1 year ago

I don't want to modify this library, I just want you to enable an option to be able to start MODS, and local versions etc... as other minecraft clients do, very simple or some other way, if I modify the code it could work but I don't have that time, it would be preferable Let the author do it. greetings.

xfl03 commented 1 year ago

Could you provide 1.19.2-Aristois.json?

andfont commented 1 year ago

It happens to me with any version that is not official, if I try to run optifine or similar it does not work, it does not detect that it is a local version! and you don't have to go looking for it, you just have to fix it in the code for it to run, now I'm not in the office so I'll send you Jason. greetings

andfont commented 1 year ago

I sent you the .jason but I repeat what happens with any local version greetings. { "id": "1.19.2-OptiFine_HD_U_H9", "inheritsFrom": "1.19.2", "time": "2023-05-25T10:26:17+02:00", "releaseTime": "2023-05-25T10:26:17+02:00", "type": "release", "libraries": [ { "name": "optifine:OptiFine:1.19.2_HD_U_H9" }, { "name": "optifine:launchwrapper-of:2.3" } ], "mainClass": "net.minecraft.launchwrapper.Launch", "arguments": { "game": [ "--tweakClass", "optifine.OptiFineTweaker" ] } }

andfont commented 1 year ago

For example version 1.19.4-Aristois is not capable either but with other lauchers, Jason passed

{ "libraries": [ { "name": "me.deftware:weaver:1.0.0", "url": "https://gitlab.com/EMC-Framework/maven/raw/master/" }, { "name": "net.fabricmc:loader-v2:latest", "url": "https://gitlab.com/EMC-Framework/maven/raw/master/" }, { "name": "net.fabricmc:sponge-mixin:0.12.4+mixin.0.8.5", "url": "https://maven.fabricmc.net/" }, { "name": "net.fabricmc:tiny-remapper:0.8.2", "url": "https://maven.fabricmc.net/" }, { "name": "net.fabricmc:tiny-mappings-parser:0.3.0+build.17", "url": "https://maven.fabricmc.net/" }, { "name": "net.fabricmc:access-widener:2.1.0", "url": "https://maven.fabricmc.net/" }, { "name": "org.ow2.asm:asm:9.4", "url": "https://maven.fabricmc.net/" }, { "name": "org.ow2.asm:asm-analysis:9.4", "url": "https://maven.fabricmc.net/" }, { "name": "org.ow2.asm:asm-commons:9.4", "url": "https://maven.fabricmc.net/" }, { "name": "org.ow2.asm:asm-tree:9.4", "url": "https://maven.fabricmc.net/" }, { "name": "org.ow2.asm:asm-util:9.4", "url": "https://maven.fabricmc.net/" }, { "name": "io.netty:netty-handler-proxy:4.1.76.Final", "url": "https://repo.maven.apache.org/maven2/" }, { "name": "com.thealtening.auth:auth:3.0.2-j9", "url": "https://repo.maven.apache.org/maven2/" }, { "name": "net.fabricmc:intermediary:1.19.4", "url": "https://maven.fabricmc.net/" }, { "name": "me.deftware:aristois:loader", "url": "https://maven.aristois.net/" }, { "name": "me.deftware:EMC-F-v2:latest-1.19.4", "url": "https://gitlab.com/EMC-Framework/maven/raw/master/" } ], "mainClass": "me.deftware.weaver.Main", "id": "1.19.4-Aristois", "time": "2023-05-25T08:19:30+00:00", "releaseTime": "2023-05-25T08:19:30+00:00", "inheritsFrom": "1.19.4", "type": "release" }