Jump to content

NoSuchFieldError: GUI Programming - A tricky one!


DrEinsteinium

Recommended Posts

Hey guys, I got a tricky one for you today...

 

I have an error in my code, yet it does not show up in Eclipse while running the game from my workspace. It only shows up when I export my modification and run it through the Minecraft launcher. Whenever I try to launch the GUI through the launcher it gives me a no such field error from the constant "width" whenever it reaches that line. I have compared my code to many different examples and yet it still will not work.

 

For starters:

 

1. I made sure that the Minecraft Forge versions in my workspace and client were the same. I double and even triple checked them after reinstalling both. Someone suggested that the code could be out of sync, but it is not the case.

 

Forge Build # (For both Launcher and Workspace)

forge.major.number=9
forge.minor.number=11
forge.revision.number=1
forge.build.number=916

 

2. Before, I had every reference to the width and height constant of the GUI referred to with "this.", and when I remove that keyword is does not make a difference. The game still crashes.

 

3. I have packaged my mod correctly based on the packaging in eclipse. Assets folders and mod folders are all in the correct places.

 

So here is the pastebin of the situation: http://pastebin.com/DE5y3dKA

 

To sum it up, I get

java.lang.NoSuchFieldError: width
        at co.einsteinium.wikilink.gui.GuiContainerWikiLinkMenu.func_73866_w_(GuiContainerWikiLinkMenu.java:64)

 

Here is the code file: GitHub

 

I would really appreciate any help on this, as I have no idea what the heck is going on. It seems like I have done everything right, but obviously not.

 

Thanks in advance,

 

 

Follow me on twitter! @keepablock

Read up on whats new! www.catacombs.co

width=700 height=60http://electronic-chronic.com/assets/keep-a-block/wikilink/wikilink_logo.png[/img]

Link to comment
Share on other sites

Q: Are you getting the error client side or server side?

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.

Link to comment
Share on other sites

I had a similar issue awhile back, caused by reobfuscation of a field I had named the same as one of MCs fields.  (I think my issue was actually with a method name, but the same/similar probably applies) 

 

Be careful with extending classes that you don't try and use duplicate field names from the parent classes (the fields may be private in the parent and not visible in the child).  What will happen is MC will obfuscate your field name in the class (because it thinks it is an vanilla MC field), but none of the references to that field (for some reason it doesn't pick up the references to the field correctly, and they retain the original name as you specified).  When it goes to call your field from one of your classes, you get the no-field found error, as that field was re-named obfuscated.

 

In short -- check your naming, make sure you don't have any duplicate named fields/methods in your classes.

Link to comment
Share on other sites

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.