0Templ / TravelersCompass

1 stars 2 forks source link

Server crash due to attempt to load client-only class #1

Closed antiphysika closed 3 months ago

antiphysika commented 3 months ago

Minecraft: 1.21 NeoForge: 21.0.18-beta Traveler's Compass: 3.0.3

I'm seeing the following on a bug-shaking-out instance:

[4:39:3] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/Minecraft (java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for in
valid dist DEDICATED_SERVER)
[...]
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinPreProcessorException: Attach error for travelerscompass.mixins.json:client.ItemMixin from mod travelerscompass during activity: [Transform -> Method travelerscompass$appendHoverText(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/Item$TooltipContext;Ljava/util/List;Lnet/minecraft/world/item/TooltipFlag;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> INVOKESTATIC -> net/minecraft/client/Minecraft::getInstance:()Lnet/minecraft/client/Minecraft;]

Server console log here

Hopefully that's all that's needed but I do have logs stashed away as well if needed.

0Templ commented 3 months ago

Thank you for pointing out this issue! The mod was trying to load client-side classes on the server side (a mixin that adds a tooltip to an item in the priority compass slot). Should be fixed in 3.0.3b. If you still encounter this or other issues, please let me know.

antiphysika commented 3 months ago

No worries! Thanks for the speedy reponse, the fix and the awesome mod :grin:

Meisterelite commented 3 months ago

The server doesn't crash anymore, thanks. But now the client can't use or change the search :( Forge 51.0.8

0Templ commented 3 months ago

The server doesn't crash anymore, thanks. But now the client can't use or change the search :( Forge 51.0.8

Thanks for letting me know! I haven't checked the compass performance on the server at all. Everything should work since version 3.0.4.

AlexJ314 commented 3 months ago

I'm running into the same error on a local Minecraft server (1.21.1 with NeoForge 21.0.43) running on Linux Mint (Cinnamon). Unfortunately the latest release of Traveler's Compass for NeoForge is 3.0.3c. The server isn't crashing, it's just spitting logs and not allowing the compass to be searched with.

0Templ commented 2 months ago

I'm running into the same error on a local Minecraft server (1.21.1 with NeoForge 21.0.43) running on Linux Mint (Cinnamon). Unfortunately the latest release of Traveler's Compass for NeoForge is 3.0.3c. The server isn't crashing, it's just spitting logs and not allowing the compass to be searched with.

Forgot to upload a fix for NeoForge version. My bad