Jump to content

[SOLVED][1.12.2] Some sort of @SideOnly error (maybe event handler related)


Recommended Posts

Posted (edited)

Okay, so I've got a mod here: https://github.com/jabelar/ExampleMod-1.12 and I'm getting a NoClassDefFound error for GuiScreen when I run a Server run configuration in Eclipse. So seems to be an @SideOnly issue. However, I'm not entirely sure why as I have my Gui classes with @SideOnly annotation and I have all code calling it (including some event handling methods) in my ClientProxy.

 

Here is full console output:

2018-02-15 22:03:55,264 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2018-02-15 22:03:55,267 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[22:03:55] [main/INFO] [GradleStart]: Extra: []
[22:03:55] [main/INFO] [GradleStart]: Running with arguments: [--tweakClass, net.minecraftforge.fml.common.launcher.FMLServerTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[22:03:55] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[22:03:55] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
[22:03:55] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[22:03:55] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker
2018-02-15 22:03:55,955 main WARN Disabling terminal, you're running in an unsupported environment.
[22:03:55] [main/INFO] [FML]: Forge Mod Loader version 14.23.1.2582 for Minecraft 1.12.2 loading
[22:03:55] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_161, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_161
[22:03:55] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[22:03:55] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[22:03:55] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[22:03:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[22:03:56] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[22:03:56] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[22:03:56] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:03:56] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[22:03:56] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[22:03:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:03:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:03:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[22:03:57] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[22:03:57] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[22:03:57] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[22:03:57] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[22:03:57] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[22:03:57] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[22:03:57] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}
[22:04:03] [Server thread/INFO]: Starting minecraft server version 1.12.2
[22:04:03] [Server thread/INFO] [FML]: MinecraftForge v14.23.1.2582 Initialized
[22:04:03] [Server thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[22:04:03] [Server thread/INFO] [FML]: Replaced 1036 ore ingredients
[22:04:04] [Server thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[22:04:04] [Server thread/INFO] [FML]: Searching E:\Modding Workspace\run\assets\mods for mods
[22:04:05] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[22:04:05] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang
[22:04:05] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, examplemod] at CLIENT
[22:04:05] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, examplemod] at SERVER
[22:04:06] [Server thread/ERROR] [FML]: An error occurred trying to load an EventBusSubscriber examplemod for modid java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
[22:04:06] [Server thread/FATAL] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue
[22:04:06] [Server thread/FATAL] [FML]: 
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID         | Version      | Source                           | Signature |
	|:----- |:---------- |:------------ |:-------------------------------- |:--------- |
	| UC    | minecraft  | 1.12.2       | minecraft.jar                    | None      |
	| UC    | mcp        | 9.42         | minecraft.jar                    | None      |
	| UC    | FML        | 8.0.99.99    | forgeSrc-1.12.2-14.23.1.2582.jar | None      |
	| UC    | forge      | 14.23.1.2582 | forgeSrc-1.12.2-14.23.1.2582.jar | None      |
	| UE    | examplemod | 1.0.0        | bin                              | None      |

[22:04:06] [Server thread/FATAL] [FML]: The following problems were captured during this phase
[22:04:06] [Server thread/ERROR] [FML]: Caught exception from examplemod (net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen)
[22:04:06] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Example Mod (examplemod)

Caused by: net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen

	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:89) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:586) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:550) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.privateGetPublicMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getMethods(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:81) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:586) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:550) ~[MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.GuiScreen
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.privateGetPublicMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getMethods(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:81) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:586) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:550) ~[MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_161]
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@5af97169 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.privateGetPublicMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getMethods(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:81) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:586) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:550) ~[MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_161]
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/GuiScreen for invalid side SERVER
	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.privateGetPublicMethods(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getMethods(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:81) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:586) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) ~[forgeSrc-1.12.2-14.23.1.2582.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) ~[Loader.class:?]
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:550) ~[MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_161]
[22:04:06] [Server thread/ERROR]: This crash report has been saved to: E:\Modding Workspace\run\assets\.\crash-reports\crash-2018-02-15_22.04.06-server.txt
[22:04:06] [Server thread/INFO]: Stopping server
[22:04:06] [Server thread/INFO]: Saving worlds
[22:04:06] [Server thread/WARN] [FML]: Can't revert to frozen GameData state without freezing first.
[22:04:06] [Server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded.
[22:04:06] [Server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.
[22:04:06] [Server Shutdown Thread/INFO]: Stopping server
[22:04:06] [Server Shutdown Thread/INFO]: Saving worlds

 

If I do a search for GuiScreen in my code, it only shows up in my GUI classes, my config GUI factory class, and my proxy. All my GUI classes have the @SideOnly annotation. My GUI factory class does not though -- is that needed?

 

Now the interesting thing is that the error message seems to be related to my event subscribers. So I'm guessing that the annotations are somehow competing -- that the SERVER side is looking at the event subscriber annotation and missing the sided annotation.

 

Basically for events that have an sided event class, such as RenderOverlayEvent() I decided to put the entire handling method in my proxy. The proxy itself of course is sided and I even go further and add the annotation to the handling method. My client proxy class is here: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/proxy/ClientProxy.java

 

I have the client proxy annotated as an @EventBusSubscriber and have the methods annotated with @SubscribeEvent. So the method code is:

    @SideOnly(Side.CLIENT)
    @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
    public static void onEvent(RenderGameOverlayEvent event)
    {
        Minecraft mc = Minecraft.getMinecraft();
        GuiIngame ingameGUI = mc.ingameGUI;
        ScaledResolution scaledRes = event.getResolution();

        if (mc.getRenderViewEntity() instanceof EntityPlayer)
        {
            EntityPlayer entityplayer = (EntityPlayer) mc.getRenderViewEntity();

            int airIndicatorX = scaledRes.getScaledWidth() / 2 + 91;
            int airIndicatorBottom = scaledRes.getScaledHeight() - 39;
            int airIndicatorTop = airIndicatorBottom - 10;

            if (entityplayer.isInsideOfMaterial(Material.WATER) || entityplayer.isInsideOfMaterial(ModMaterials.SLIME))
            {
                int airAmount = mc.player.getAir();
                int airLostPercent = MathHelper.ceil((airAmount - 2) * 10.0D / 300.0D);
                int airLeftPercent = MathHelper.ceil(airAmount * 10.0D / 300.0D) - airLostPercent;

                for (int airUnitIndex = 0; airUnitIndex < airLostPercent + airLeftPercent; ++airUnitIndex)
                {
                    if (airUnitIndex < airLostPercent)
                    {
                        ingameGUI.drawTexturedModalRect(airIndicatorX - airUnitIndex * 8 - 9, airIndicatorTop, 16, 18, 9, 9);
                    }
                    else
                    {
                        ingameGUI.drawTexturedModalRect(airIndicatorX - airUnitIndex * 8 - 9, airIndicatorTop, 25, 18, 9, 9);
                    }
                }
            }
        }
    }

 

So I feel that I am double-protected for a sided problem but there is still an issue. If I comment out some of the methods in my event handler, the error changes (it complains about a different class) so it definitely seems to be related to the client proxy event handling classes. But I really don't understand it since it is fully sided.

 

Also, after I comment out all the event handlers I am left with a console error complaining about NoClassDefFound for EntityPlayerSP in the event subscriber. But a Java search of my project shows that I don't reference that class anywhere!

 

Anyway, I'm probably doing something stupid but it feels like there might be some conflict with the @EventSubscriber and @SideOnly annotations in a client proxy?

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Yeah, it seems that having the client proxy class also be an @EventSubscriber isn't possible? If I comment out the @EventSubscriber the errors go away. I guess the event subscriber annotation picks up the classes and methods even though there is an @SideOnly annotation.

 

I can put the event handlers back outside the proxy, but I was getting errors that way too. It is weird though because I've done GUIs and such for quite a while without previous problem. I'll keep trying to isolate the problem code...

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted (edited)

I moved the event handling from the proxy to an independent event handling class and now the error goes away. It seems that maybe having the client proxy also be an event handler for sided events might have some conflict. Or maybe something happened when I was moving the methods out of the proxy that inadvertently fixed it. 

 

Does anyone know how having sided event handlers inside the proxy might cause trouble with sided class loading?

 

One thing I noticed was that you can't put @SideOnly annotation on your client proxy class otherwise you get an error that the ClientProxy class itself is a no class def error. So I'm thinking that the client proxy class is technically loaded in some manner even on the server and I guess that allows the event handler to look at subscriptions for methods in the class even though on the server that shouldn't happen.

 

I might play with this using a more targeted sample mod to see if there is an actual bug, or if it is just my poor understanding of this.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
57 minutes ago, jabelar said:

Yeah, it seems that having the client proxy class also be an @EventSubscriber isn't possible? If I comment out the @EventSubscriber the errors go away. I guess the event subscriber annotation picks up the classes and methods even though there is an @SideOnly annotation.

 

You need to tell Forge to only load and register the class on a specific side by passing a Side argument to the @EventBusSubscriber annotation. You can see an example of this here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.