[BUG] <'ClientLevel for invalid dist DEDICATED_SERVER' Log Message>
rileyyy-mills opened this issue ยท 8 comments
Is there an existing issue for this?
- I have searched the existing issues
Are you using the latest MineColonies Version?
- I am running the latest beta version of MineColonies for my Minecraft version.
Did you check on the Wiki? or ask on Discord?
- I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.
Minecraft Version
1.20.1
MineColonies Version
1.20.1-1.1.606
Structurize Version
1.20.1-1.0.742
Related Mods and their Versions
- Forge: 1.20.1-47.3.5
- Donum Ornamentum: 1.20.1-1.0.186
- Block UI: 1.20.1-1.0.156
- Multipiston: 1.20-1.2.43
Reproduction Steps
- Install Donum Ornamentum, Block UI, and Multipiston on a server.
- Start server.
- Open Server Latest Log & ctrl+f search for "ClientLevel for invalid dist DEDICATED_SERVER".
- No results should show.
- Install MineColonies.
- Restart server.
- Open Server Latest Log & ctrl+f search for "ClientLevel for invalid dist DEDICATED_SERVER".
- Multiple results of "[Server thread/ERROR] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/multiplayer/ClientLevel for invalid dist DEDICATED_SERVER" should show.
Logs
Anything else?
NOTE: I have this installed in a custom curse forge mod pack that I made for me and my friends on a Hostinger server. However, this error log does NOT appear when I have all mods within the pack already installed beforehand, including Donum Ornamentum, Block UI, and Multipiston. Only AFTER installing MineColonies on top of all those mods do I then receive the log message I mentioned above. It's possible that the mod is conflicting with another mod, but this ONLY happens after installing the MineColonies mod. Hopefully this is just a conflict, or something silly that I did so that it's an easy fix on my part. But if there is anything I can do to help or provide more information, please let me know.
If it helps to know everything listed in the mods folder on my server, I created a pastebin file to list them all for you. Thanks again for your help!
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.
The server starts without crashing, but since it's a fresh setup, I don't know if this will cause issues when players start creating colonies. I haven't seen any other client-server mods display this message, so I thought I'd report it in case it's a sign of potential problems down the line. I'm not very familiar with Minecraft modding, so I was also unsure whether this could cause problems with my server later on, or if it'll still be fine despite the client-side messages.
I'll load into my server today and test as many MineColonies functions as I can to see if anything breaks and crashes it. If something does, I'll be sure to update you with the log.
Noticed the same error on my server (Forge 47.3.5), hasn't crashed anything though.
[Server thread/ERROR] [ne.mi.fm.lo.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/multiplayer/ClientLevel for invalid dist DEDICATED_SERVER
[Server thread/WARN] [Radium Class Analysis/]: Radium Class Analysis Error: Class com.minecolonies.core.blocks.huts.BlockHutTownHall cannot be analysed, because getting declared methods crashes with RuntimeException: Attempted to load class net/minecraft/client/multiplayer/ClientLevel for invalid dist DEDICATED_SERVER. This is usually caused by modded entities declaring methods that have a return type or parameter type that is annotated with @onlyin(Dist.CLIENT). Loading the type is not possible, because it only exists in the CLIENT environment. The recommended fix is to annotate the method with this argument or return type with the same annotation. Lithium handles this error by assuming the class cannot be included in some optimizations.
The fact is, it's a static codescan giving this warning, this doesn't reflect real usage
I condemn!))
This is some kind of dirty behavior.
Obviously, the error occurs in the maincolony.
This error was on previous versions and is still there. You still haven't solved it.
Radium Class Analysis Error: An error generated by the Radium mod, which optimizes Minecraft. There may be similar errors with the Lithium mod.
Class com.minecolonies.core.blocks.huts.BlockHutTownHall cannot be analyzed: Indicates that the problem is related to the BlockHutTownHall class from the Minecolonies mod.
RuntimeException: Attempted to load class net/minecraft/client/multiplayer/ClientLevel for invalid dist DEDICATED_SERVER: Reports that the BlockHutTownHall class is trying to load the ClientLevel class, which exists only on the client side, while the server is running on DEDICATED_SERVER (dedicated server).
This is usually caused by modded entities declaring methods that have a return type or parameter type that is annotated with @OnlyIn(Dist.CLIENT): Explains that the reason is that in the code of the BlockHutTownHall class there are methods that use data types intended only for the client (annotation @OnlyIn(Dist.CLIENT)), but are also used on the server.
The recommended fix is to annotate the method with this argument or return type with the same annotation: Suggests a fix: add the @OnlyIn(Dist.CLIENT) annotation to the method or argument that is causing the problem. But it is not always possible to do this.
Lithium handles this error by assuming the class cannot be included in some optimizations: If the Lithium mod is used, it simply ignores the class for optimization.
Radium is known to cause problems in the first place, don't use it. There is nothing wrong with what we are doing since the given methods aren't actually called on the server at all, this is a method only invoked by the client. The block classes just contain a bit of logic for both the server and client to utilize.
Radium is a static analyzer tool and will assume it's wrong, but it won't look for actual usages, at which point it's actually not a problem at all.
Hmm... well, I may not understand a lot of things. But it's still weird.
The fact is that an error appears in the server console that the mod outputs something related to the client side, but since this is the client side, the server issues an error.
After that, a warning from radium immediately appears.
It's a pity that I can't provide logs. I deleted all the logs and changed the build.