Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Forge (via Sinytra Connector) when Connector Extras is installed #1

Closed
unilock opened this issue Feb 22, 2024 · 4 comments · Fixed by #2
Closed

Crash on Forge (via Sinytra Connector) when Connector Extras is installed #1

unilock opened this issue Feb 22, 2024 · 4 comments · Fixed by #2
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@unilock
Copy link

unilock commented Feb 22, 2024

The mod crashes when running on Forge under Sinytra Connector when Connector Extras is also installed. This is because Connector Extras provides the modmenu mod ID, but doesn't re-implement non-API classes of Mod Menu; only its config API.

Stacktrace (with emogg)
net.minecraftforge.fml.loading.EarlyLoadingException: Could not execute entrypoint stage 'client' due to errors, provided by 'emogg'!
	at dev.su5ed.sinytra.connector.loader.ConnectorEarlyLoader.createLoadingException(ConnectorEarlyLoader.java:81) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at dev.su5ed.sinytra.connector.loader.ConnectorEarlyLoader.createGenericLoadingException(ConnectorEarlyLoader.java:77) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at dev.su5ed.sinytra.connector.mod.ConnectorLoader.load(ConnectorLoader.java:55) ~[Connector-1.0.0-beta.36+1.20.1-mod.jar%23723!/:1.0.0-beta.36+1.20.1] {re:mixin,re:classloading}
	at net.minecraft.client.Minecraft.handler$eig000$connectormod$earlyInit(dev/su5ed/sinytra/connector/mod/mixin/boot/MinecraftMixin.java [connectormod.mixins.json]:15) ~[client-1.20.1-20230612.114412-srg.jar%231294!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,pl:connector_pre_launch:A,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,pl:mixin:A,pl:connector_pre_launch:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:424) ~[client-1.20.1-20230612.114412-srg.jar%231294!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,pl:connector_pre_launch:A,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,pl:mixin:A,pl:connector_pre_launch:A,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:182) ~[minecraft-1.20.1-client.jar:?] {re:mixin,pl:connector_pre_launch:A,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin from mod flywheel,pl:mixin:APP:mixins.emibridge.json:MainEntrypointMixin from mod connectorextras_emi_bridge,pl:mixin:A,pl:connector_pre_launch:A,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:126) ~[loader-47.1.47.jar:47.1] {}
	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:114) ~[loader-47.1.47.jar:47.1] {}
	at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.runService(CommonClientLaunchHandler.java:24) ~[loader-47.1.47.jar:47.1] {}
	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:108) ~[loader-47.1.47.jar:47.1] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?] {}
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}
	at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
	at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:67) ~[?:?] {}
	at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:87) ~[?:?] {}
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:125) ~[?:?] {}
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[?:?] {}
Caused by: java.lang.RuntimeException: Could not execute entrypoint stage 'client' due to errors, provided by 'emogg'!
	at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$0(FabricLoaderImpl.java:131) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:129) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at dev.su5ed.sinytra.connector.mod.ConnectorLoader.load(ConnectorLoader.java:46) ~[Connector-1.0.0-beta.36+1.20.1-mod.jar%23723!/:1.0.0-beta.36+1.20.1] {re:mixin,re:classloading}
	... 23 more
Caused by: java.lang.NoClassDefFoundError: com/terraformersmc/modmenu/ModMenu
	at io.github.aratakileo.elegantia.util.ModInfo.setConfigScreenGetter(ModInfo.java:78) ~[elegantia-0.0.1-alpha+1.20-1.20.1_mapped_srg_1.20.1.jar%232915!/:?] {re:classloading}
	at io.github.aratakileo.elegantia.gui.config.Config.init(Config.java:324) ~[elegantia-0.0.1-alpha+1.20-1.20.1_mapped_srg_1.20.1.jar%232915!/:?] {re:classloading}
	at io.github.aratakileo.emogg.Emogg.onInitializeClient(Emogg.java:70) ~[emogg-2.0.0+1.20-1.20.1-forged_mapped_srg_1.20.1.jar%232916!/:?] {re:mixin,re:classloading}
	at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:127) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at dev.su5ed.sinytra.connector.mod.ConnectorLoader.load(ConnectorLoader.java:46) ~[Connector-1.0.0-beta.36+1.20.1-mod.jar%23723!/:1.0.0-beta.36+1.20.1] {re:mixin,re:classloading}
	... 23 more
Caused by: java.lang.ClassNotFoundException: com.terraformersmc.modmenu.ModMenu
	at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?] {}
	at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] {}
	at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:137) ~[securejarhandler-2.1.10.jar:?] {}
	at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] {}
	at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:137) ~[securejarhandler-2.1.10.jar:?] {}
	at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] {}
	at io.github.aratakileo.elegantia.util.ModInfo.setConfigScreenGetter(ModInfo.java:78) ~[elegantia-0.0.1-alpha+1.20-1.20.1_mapped_srg_1.20.1.jar%232915!/:?] {re:classloading}
	at io.github.aratakileo.elegantia.gui.config.Config.init(Config.java:324) ~[elegantia-0.0.1-alpha+1.20-1.20.1_mapped_srg_1.20.1.jar%232915!/:?] {re:classloading}
	at io.github.aratakileo.emogg.Emogg.onInitializeClient(Emogg.java:70) ~[emogg-2.0.0+1.20-1.20.1-forged_mapped_srg_1.20.1.jar%232916!/:?] {re:mixin,re:classloading}
	at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:127) ~[Connector-1.0.0-beta.36+1.20.1.jar%23718!/:1.0.0-beta.36+1.20.1] {}
	at dev.su5ed.sinytra.connector.mod.ConnectorLoader.load(ConnectorLoader.java:46) ~[Connector-1.0.0-beta.36+1.20.1-mod.jar%23723!/:1.0.0-beta.36+1.20.1] {re:mixin,re:classloading}
	... 23 more

The issue is here:

/*
* Adding configuration screens is necessary in this way, due to the fact
* that the `ModMenuApi#getProvidedConfigScreenFactories` interface works every other time
*/
final var field = ModMenu.class.getDeclaredField("configScreenFactories");
field.setAccessible(true);

It appears that reflecting a non-API class of Mod Menu like this is not entirely safe. Could there be an alternative? ( or at least a check for if (!isModLoaded("connectormod")) return; :p )

@aratakileo
Copy link
Owner

I'm confused, but I have found a solution to this problem. The game does not crash if you use the Forgified Fabric API in addition to the Sinytra Connector. I will add this dependency to the version page

p.s. I did not notice the problem you described, due to the fact that I ran a test by Neoforge with the Forgified Fabric API installed. Tsym for promptly reporting the problem

@aratakileo
Copy link
Owner

aratakileo commented Feb 22, 2024

Btw, in the future, it is planned to port Elegantia and Emogg to multiloader, so that the changes you have proposed will not be applied

@aratakileo aratakileo added the bug Something isn't working label Feb 22, 2024
@aratakileo aratakileo self-assigned this Feb 22, 2024
@aratakileo aratakileo added the good first issue Good for newcomers label Feb 22, 2024
@unilock
Copy link
Author

unilock commented Feb 22, 2024

I already have Forgified Fabric API installed; it doesn't fix the issue. The issue arises when Connector Extras is installed.

@aratakileo
Copy link
Owner

aratakileo commented Feb 23, 2024

Oh. Now I understand the problem better:

  • Sinytra Connector = crash
  • Sinytra Connector + Forgified Fabric API = ok
  • Sinytra Connector + Connector Extras = crash

What am I going to do about it:

  • I will mark on the version page that the mod is not compatible with Connector Extras
  • I will make the changes you suggested to the code, adjusting it to take into account the above

@aratakileo aratakileo reopened this Feb 23, 2024
@aratakileo aratakileo linked a pull request Feb 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants