Jump to content

Recommended Posts

Posted

Oke so I just updated to the newest minecraft forge version (4.2.5) and updated parts of my mod to work with it. Only problem there isn't any coded bug that eclipse can find and my minecraft keeps on craching. It has somthing to do with the mod's "instance" here is the bug report

 

 

cpw.mods.fml.common.LoaderException: java.lang.IllegalArgumentException: Can not set static MoreTools.MT_mod field MoreTools.MT_mod.instance to MoreFood.MF_mod
at cpw.mods.fml.common.LoadController.transition(LoadController.java:102)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:467)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:146)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:416)
at net.minecraft.client.Minecraft.run(Minecraft.java:748)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Can not set static MoreTools.MT_mod field MoreTools.MT_mod.instance to MoreFood.MF_mod
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:395)
at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:321)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:415)
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.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124)
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.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:466)
... 4 more
--- END ERROR REPORT 8cac8aee ----------

 

 

 

and the 2 mod files that have a instance

MT_mod

 

 

@Instance
public static MT_mod instance;
// if more code is needed I will provide it!

 

 

MF_mod

 

 

@Instance
public static MF_mod instance;
// if more code is needed I will provide it!

 

 

 

Greets,

 

MrJPGames

I try not to be mean about your english (as my own isn't the best either) but sometimes I can't help myself!

If you get mad at me for this or any other reason, please look at the profile picture so you'll feel better (and pretier) than me!

Thanks.

Posted

You're setting MT_mod's instance to an instance of MF_mod.

Protip: try and find answers yourself before asking on the forum.

It's pretty likely that there is an answer.

 

Was I helpful? Give me a thank you!

 

 

width=635 height=903http://bit.ly/HZ03zy[/img]

 

 

Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

Posted

what should I change then I tryed renaming both instances to somthing like MTinstance

and MFinstance but I still get the same error as before!!

I try not to be mean about your english (as my own isn't the best either) but sometimes I can't help myself!

If you get mad at me for this or any other reason, please look at the profile picture so you'll feel better (and pretier) than me!

Thanks.

Posted

Use @Instance("MODID")

 

and replace MODID with the ID string of your mod (which you defined in your @Mod annotation:

@Mod(modid="MODID",[...])

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.