Posted August 30, 20169 yr Hello, I want to use API of other mod, but I get error, even if I use it in a try.. I would like to make it work even without having that API mod. So should I check if player has this API mod, or is there some other better way? try { world.setBlockState(position), BlockBOPSapling.paging.getVariantState(BOPTrees.BAMBOO)); } catch (NoClassDefFoundError e) { System.out.println(e); } net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: biomesoplenty/api/enums/BOPTrees at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:186) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:790) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:322) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:520) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:351) at net.minecraft.client.main.Main.main(SourceFile:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: biomesoplenty/api/enums/BOPTrees at mymode.core.EventHandler.<init>(EventHandler.java:20) at mymode.core.Fauns.init(Fauns.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:239) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:788) ... 10 more Caused by: java.lang.ClassNotFoundException: biomesoplenty.api.enums.BOPTrees at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 39 more Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 41 more
August 30, 20169 yr @Optional is part of the cpw.mods.fml.common.Optional package. Eclipse isn't very good at being able to auto-import that particular annotation, usually because it requires a parameter and if you don't have it (because you don't know what it is) the package can't be determined. I had a lot of trouble the first time I tried to use it. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 30, 20169 yr Wait, what? In my 1.10.2 workspace I don't have the cpw package at all, the only Optional I have is net.minecraftforge.fml.common.Optional
August 30, 20169 yr Wait, what? In my 1.10.2 workspace I don't have the cpw package at all, the only Optional I have is net.minecraftforge.fml.common.Optional Ah, it got moved, I forgot about that. Sorry, last time I used it was 1.7.10 Had a real tough time locating the right package so I could see what it's usage parameters were! Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 30, 20169 yr Author Ok I simply made a new class with @Optional.Interface(iface = "package", modid = "MOD_ID") and everything is fine
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.