Résolu [ NoSuchFieldError ]
-
Bonjour
J’ai un soucis avec l’un de mes bloc, Quand je lance la run avec eclipse ca fonctionne mais quand le lance le mod avec le laucnher client ça crash .
J’ai constaté que j’avais un NoSuchFieldError mais je ne sais pas comment régler ce problème.CrashReport :
–-- Minecraft Crash Report ----
// Don’t be sad. I’ll do better next time, I promise!Time: 08/07/15 09:35
Description: There was a severe problem during mod loading that has caused the game to failcpw.mods.fml.common.LoaderException: java.lang.NoSuchFieldError: glass
at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:559)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.NoSuchFieldError: glass
at com.google.SpyMan.MoreStuffs.common.MoreStuffs.preInit(MoreStuffs.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
… 10 moreMon Code (ligne 93):
Lantern = new Lantern(Material.glass).setBlockName("Lantern").setCreativeTab(Ctab).setBlockTextureName(MODID + ":Lantern");
-
Pour compiler ton mod tu dois utiliser la commande gradlew build et non exporter avec eclipse, sinon le mod ne sera pas obfusqué.
Il faut taper la commande dans la console (comme pour le setup, en étant dans le dossier Forge), le fichier jar se trouvera dans le dossier forge-src/build/libs