BEFORE REPORTING MAKE SURE:
[ ] You are on the newest version of Kontraption and Valkyrien Skies.
[ ] You have tested it with only Kontraption, Valkyrien Skies, Mekanism and Kotlin for Forge installed.
[ ] The bug hasn't been reported already.
Describe the bug
When using the Kontraption mod on the Minecraft server, it crashes during initialization with an error message indicating that the mod failed to load correctly. The error is caused by an InvocationTargetException when the mod attempts to load the net/minecraft/client/renderer/LevelRenderer class, which is a client-side class and cannot be loaded on the server.
To Reproduce
Steps to reproduce the behavior:
Install the Kontraption mod on the server.
Launch the server.
The server crashes during initialization.
Expected behavior
The server should start normally with the Kontraption mod loaded without any crashes.
Screenshots/videos
No screenshots or videos provided.
Logs
[156月2025 14:26:49.139] [modloading-worker-0/ERROR] [thedarkcolour.kotlinforforge.LoggerKt/LOADING]: Failed to create mod instance. ModID: kontraption, class net.illuc.kontraption.Kontraption
java.lang.reflect.InvocationTargetException: null
at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:74) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
at thedarkcolour.kotlinforforge.KotlinModContainer.constructMod(KotlinModContainer.kt:64) ~[kfflang-4.11.0.jar%23320!/:4.11.0]
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler
5(ModContainer.java:126) [fmlcore−1.20.1−47.4.1.jaratjava.util.concurrent.CompletableFuture
AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.util.concurrent.CompletableFuture
AsyncRun.exec(CompletableFuture.java:1796) [?:?]atjava.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) [?:?]atjava.util.concurrent.ForkJoinPool
WorkQueue.topLevelExec(ForkJoinPool.java:1310) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/LevelRenderer for invalid dist DEDICATED_SERVER
at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:57) ~[fmlloader-1.20.1-47.4.1.jar%2369!/:1.0]
at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?]
at cpw.mods.cl.ModuleClassLoader.lambda$findClass
15(ModuleClassLoader.java:219) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) [securejarhandler−2.1.10.jar:?]atjava.lang.ClassLoader.loadClass(ClassLoader.java:526) [?:?]atjava.lang.Class.getDeclaredConstructors0(NativeMethod) [?:?]atjava.lang.Class.privateGetDeclaredConstructors(Class.java:3549) [?:?]atjava.lang.Class.getConstructor0(Class.java:3754) [?:?]atjava.lang.Class.getConstructor(Class.java:2442) [?:?]atnet.minecraftforge.eventbus.api.EventListenerHelper.computeListenerList(EventListenerHelper.java:75) [eventbus−6.0.5.jaratnet.minecraftforge.eventbus.api.EventListenerHelper.lambda
getListenerListInternal$0(EventListenerHelper.java:56) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:61) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.get(LockHelper.java:44) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:39) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerListInternal(EventListenerHelper.java:56) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerList(EventListenerHelper.java:50) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addToListeners(EventBus.java:276) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:252) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:244) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:199) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:193) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:187) ~[eventbus-6.0.5.jar%2352!/:?]
at net.illuc.kontraption.Kontraption.
Versions
VS2 version: [Forge 1.20.1] v2.3.0-beta.7
Mekanism version: 10.4.16.80
Additional context
The server crashes specifically due to the Kontraption mod attempting to load a client-side class on the server. This issue does not occur in single-player mode.
BEFORE REPORTING MAKE SURE:
[ ] You are on the newest version of Kontraption and Valkyrien Skies.
[ ] You have tested it with only Kontraption, Valkyrien Skies, Mekanism and Kotlin for Forge installed.
[ ] The bug hasn't been reported already.
Describe the bug
When using the Kontraption mod on the Minecraft server, it crashes during initialization with an error message indicating that the mod failed to load correctly. The error is caused by an InvocationTargetException when the mod attempts to load the net/minecraft/client/renderer/LevelRenderer class, which is a client-side class and cannot be loaded on the server.
To Reproduce
Steps to reproduce the behavior:
Install the Kontraption mod on the server.
Launch the server.
The server crashes during initialization.
Expected behavior
The server should start normally with the Kontraption mod loaded without any crashes.
Screenshots/videos
No screenshots or videos provided.
Logs
[156月2025 14:26:49.139] [modloading-worker-0/ERROR] [thedarkcolour.kotlinforforge.LoggerKt/LOADING]: Failed to create mod instance. ModID: kontraption, class net.illuc.kontraption.Kontraption
java.lang.reflect.InvocationTargetException: null
at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:74) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
at thedarkcolour.kotlinforforge.KotlinModContainer.constructMod(KotlinModContainer.kt:64) ~[kfflang-4.11.0.jar%23320!/:4.11.0]
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler
5(ModContainer.java:126) [fmlcore−1.20.1−47.4.1.jaratjava.util.concurrent.CompletableFuture
AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.util.concurrent.CompletableFuture
AsyncRun.exec(CompletableFuture.java:1796) [?:?]atjava.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) [?:?]atjava.util.concurrent.ForkJoinPool
WorkQueue.topLevelExec(ForkJoinPool.java:1310) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/LevelRenderer for invalid dist DEDICATED_SERVER
at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:57) ~[fmlloader-1.20.1-47.4.1.jar%2369!/:1.0]
at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar%2355!/:?]
at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?]
at cpw.mods.cl.ModuleClassLoader.lambda$findClass
15(ModuleClassLoader.java:219) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) [securejarhandler−2.1.10.jar:?]atcpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) [securejarhandler−2.1.10.jar:?]atjava.lang.ClassLoader.loadClass(ClassLoader.java:526) [?:?]atjava.lang.Class.getDeclaredConstructors0(NativeMethod) [?:?]atjava.lang.Class.privateGetDeclaredConstructors(Class.java:3549) [?:?]atjava.lang.Class.getConstructor0(Class.java:3754) [?:?]atjava.lang.Class.getConstructor(Class.java:2442) [?:?]atnet.minecraftforge.eventbus.api.EventListenerHelper.computeListenerList(EventListenerHelper.java:75) [eventbus−6.0.5.jaratnet.minecraftforge.eventbus.api.EventListenerHelper.lambda
getListenerListInternal$0(EventListenerHelper.java:56) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:61) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.get(LockHelper.java:44) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:39) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerListInternal(EventListenerHelper.java:56) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerList(EventListenerHelper.java:50) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addToListeners(EventBus.java:276) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:252) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:244) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:199) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:193) ~[eventbus-6.0.5.jar%2352!/:?]
at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:187) ~[eventbus-6.0.5.jar%2352!/:?]
at net.illuc.kontraption.Kontraption.
Versions
VS2 version: [Forge 1.20.1] v2.3.0-beta.7
Mekanism version: 10.4.16.80
Additional context
The server crashes specifically due to the Kontraption mod attempting to load a client-side class on the server. This issue does not occur in single-player mode.