Jump to content

[1.14.4] NullPointerException after accessing item group


apocalypse3000

Recommended Posts

As I mentioned, I am getting java.lang.NullPointerException every time I try to access my own item group or reaching the end All Items or when I give Infused Soul Shard using /give command.

Other items and blocks work fine. Infused Soul Shard is somehow causing game crashes. It works fine when I comment rows 55-169 in items.InfusedSoulShard.

I think that problem is in tooltips, but I'm not really sure. Could anybody help me please? Here's link to my project with log enclosed.

https://github.com/apocalypse3000/jassa

Edited by apocalypse3000
Link to comment
Share on other sites

Because your item group is created the minute your first item gets constructed, which is before the fields in your ModItem class have been given values via the @ObjectHolder annotation.

 

This is why ModItemGroup exists:

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/industry/ExpandedIndustry.java#L59

Edited by Draco18s

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

30 minutes ago, apocalypse3000 said:

How can I implement HardLib to gradle? I tried to add an existing github project to my build.gradle file but all my attempts have failed? I didn't find any HardLib 1.14.4 jar files. Is there any other way make ItemGroup construct after items are given values?

Don't. I forgot that that was my class. Just create it yourself in your own project:

 

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/internal/ModItemGroup.java

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

Man, if only I knew what line the crash was on and what the error was.

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 found out where the problem was. The problem was that I didn't have config variable in main group. I changed MODID to public and added an annotation above class EventHandler. Do I need EasyRegistry items to see them in all items in creative? If I add group(ItemGroup.jassa) to item properties, I can see all items and blocks two times in group jassa.

Edited by apocalypse3000
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.