ModernFix

ModernFix

72M Downloads

Don't initialize client mixins in a server environment

Ristovski opened this issue ยท 5 comments

commented

It seems that ModernFix tries to initialize all mixins regardless of the environment. On servers this causes the following annoying albeit harmless errors from attempting to load the client mixins:

[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_340 (java.lang.ClassNotFoundException: net/minecraft/class_340)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_340 was not found modernfix-fabric.mixins.json:feature.branding.GuiMixin from mod modernfix
[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_1043 (java.lang.ClassNotFoundException: net/minecraft/class_1043)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_1043 was not found modernfix-fabric.mixins.json:safety.DynamicTextureMixin from mod modernfix
[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_310 (java.lang.ClassNotFoundException: net/minecraft/class_310)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_310 was not found modernfix-fabric.mixins.json:core.MCMixin_Fabric from mod modernfix
[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_634 (java.lang.ClassNotFoundException: net/minecraft/class_634)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_634 was not found modernfix-fabric.mixins.json:core.ClientPlayNetHandlerMixin from mod modernfix
[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_1071 (java.lang.ClassNotFoundException: net/minecraft/class_1071)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_1071 was not found modernfix-common.mixins.json:perf.cache_profile_texture_url.SkinManagerMixin from mod modernfix
[22:14:12] [main/WARN]: Error loading class: net/minecraft/class_310 (java.lang.ClassNotFoundException: net/minecraft/class_310)
[22:14:12] [main/WARN]: @Mixin target net.minecraft.class_310 was not found modernfix-common.mixins.json:bugfix.world_leaks.MinecraftMixin from mod modernfix
[22:14:13] [main/WARN]: Error loading class: net/minecraft/class_528$class_4272 (java.lang.ClassNotFoundException: net/minecraft/class_528$class_4272)
[22:14:13] [main/WARN]: @Mixin target net.minecraft.class_528$class_4272 was not found modernfix-common.mixins.json:bugfix.world_screen_skipped.WorldSelectionListMixin from mod modernfix
[22:14:13] [main/WARN]: Error loading class: net/minecraft/class_287 (java.lang.ClassNotFoundException: net/minecraft/class_287)
[22:14:13] [main/WARN]: @Mixin target net.minecraft.class_287 was not found modernfix-common.mixins.json:bugfix.buffer_builder_leak.BufferBuilderMixin from mod modernfix

The mixins should be registered as per https://fabricmc.net/wiki/tutorial:mixin_registration#register_mixins, i.e. client mixins should be defined as client and server mixins as server, instead of a unifying them all.

commented

I was about to post about these message when using modernfix on Forge servers - hopefully a similar resolution could be done, or at least the log output silenced? Please for the love of god lol.

[10May2023 20:45:12.036] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/gui/screens/worldselection/CreateWorldScreen (java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/screens/worldselection/CreateWorldScreen for invalid dist DEDICATED_SERVER)
[10May2023 20:45:12.036] [main/WARN] [mixin/]: @Mixin target net.minecraft.client.gui.screens.worldselection.CreateWorldScreen was not found modernfix-common.mixins.json:perf.dedicated_reload_executor.CreateWorldScreenMixin
[10May2023 20:45:12.044] [main/ERROR] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/gui/screens/worldselection/WorldOpenFlows for invalid dist DEDICATED_SERVER
[10May2023 20:45:12.044] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/gui/screens/worldselection/WorldOpenFlows (java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/screens/worldselection/WorldOpenFlows for invalid dist DEDICATED_SERVER)
[10May2023 20:45:12.044] [main/WARN] [mixin/]: @Mixin target net.minecraft.client.gui.screens.worldselection.WorldOpenFlows was not found modernfix-common.mixins.json:perf.dedicated_reload_executor.WorldOpenFlowsMixin
[10May2023 20:45:12.082] [main/ERROR] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/gui/screens/worldselection/CreateWorldScreen for invalid dist DEDICATED_SERVER
[10May2023 20:45:12.083] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/gui/screens/worldselection/CreateWorldScreen (java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/screens/worldselection/CreateWorldScreen for invalid dist DEDICATED_SERVER)
[10May2023 20:45:12.083] [main/WARN] [mixin/]: @Mixin target net.minecraft.client.gui.screens.worldselection.CreateWorldScreen was not found modernfix-forge.mixins.json:perf.skip_first_datapack_reload.CreateWorldScreenMixin```
commented

I will fix these warnings/errors when I have time. They are harmless, and should not cause any issues at runtime.

commented

Understand that - however it causes confusion with many users thinking that it's a client side only mod. Also, any type of issue-finding script looking at logs flags this. Thanks!

commented

Understand that - however it causes confusion with many users thinking that it's a client side only mod. Also, any type of issue-finding script looking at logs flags this. Thanks!

You should probably not use a script, seeing as other mods will trigger class-loading errors sometimes.

commented

Most, if not all occurences of these errors should be fixed in 5.10.0. Please open a new issue if you encounter more.

@Phoenix-Starlight is working on a more robust solution to this issue.