Jump to content

Gun Mod Crash


thatbritshgamer

Recommended Posts

NPE is easy to solve. One of these is null:

 

if (hasAttachment(stack, MainRegistry.content().ironSights.getName()))

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

could you help me have no idea why it is a npe

Tell us what "it" is. You're the one with the debugger! Set a breakpoint in the offending method and then look at values and step into method calls.

 

For debugging, it can help a bit to break apart complex expressions into several discrete assignments. For example, replace

 

    MainRegistry.content().ironSights.getName())

 

with something like

 

    c = MainRegistry.content();

    s = c.ironSights;

    n = s.getName();

 

to narrow down the location of the error.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

The error you have can be explained like this:

 

Would you please remove the lid of the peanut butter jar you are currently holding?

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

  • 5 years later...
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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