Fix WrongMethodTypeException. Invoke exact don't work like that
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
cae1ba7cd8
commit
779bc2c63d
@ -63,7 +63,6 @@ import org.prismlauncher.utils.ReflectionUtils;
|
|||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
public final class StandardLauncher extends AbstractLauncher {
|
public final class StandardLauncher extends AbstractLauncher {
|
||||||
|
|
||||||
@ -100,7 +99,7 @@ public final class StandardLauncher extends AbstractLauncher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MethodHandle method = ReflectionUtils.findMainMethod(this.mainClassName);
|
MethodHandle method = ReflectionUtils.findMainMethod(this.mainClassName);
|
||||||
method.invokeExact((Object[]) launchParameters.toArray(new String[0]));
|
method.invokeExact(launchParameters.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class StandardLauncherProvider implements LauncherProvider {
|
private static class StandardLauncherProvider implements LauncherProvider {
|
||||||
|
@ -132,7 +132,7 @@ public final class LegacyLauncher extends AbstractLauncher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MethodHandle method = ReflectionUtils.findMainEntrypoint(main);
|
MethodHandle method = ReflectionUtils.findMainEntrypoint(main);
|
||||||
method.invokeExact((Object[]) mcParams.toArray(new String[0]));
|
method.invokeExact(mcParams.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class LegacyLauncherProvider implements LauncherProvider {
|
private static class LegacyLauncherProvider implements LauncherProvider {
|
||||||
|
Loading…
Reference in New Issue
Block a user