Bubbles

Bubbles

30.9k Downloads

Config JSON loader calls the client-side Minecraft class on servers, causing crashes

bruberu opened this issue ยท 1 comments

commented

Currently, it appears that when the config is loaded, it attempts to get the game directory using the Minecraft class, which is only available on clients. This currently makes the mod unusable on servers. (As a side note, as you do more work on this mod, it can help to run a quick runServer before releasing versions, although it took a while for me to do this with my own mod.)

To fix this issue, I think you could do something like what GregTech CEu does at line 155 of this file: https://github.com/GregTechCEu/GregTech/blob/master/src/main/java/gregtech/api/worldgen/config/WorldGenRegistry.java

Here's the core error:

Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft
    at baubles.common.Config.initJsonConfig(Config.java:36)
    at baubles.common.Config.initialize(Config.java:32)
    at baubles.common.Baubles.preInit(Baubles.java:43)
commented

Fixed in this