Jump to content

[1.12.2] NonNullList not being changed?


Hamhub7
 Share

Recommended Posts

So I am trying to add elements in the periodic table to Minecraft. For some reason, my tooltip for displaying the information about the element does not display the correct information. The item is ItemElement. The tooltip works for the atomic number, boiling point, and melting point, but not for mass or any of the other values (but i'm most concerned about the mass). I suspect the problem is coming from the items not being added to the NonNullList in the ElementUtil file. What is confusing me is the fact that some work and others don't. Any help would be appreciated!

 

Github:

https://github.com/hamhub7/LabDay

 

ItemElement: https://github.com/hamhub7/LabDay/blob/master/src/main/java/com/hamhub7/labday/item/ItemElement.java

ElementUtil: https://github.com/hamhub7/LabDay/blob/master/src/main/java/com/hamhub7/labday/util/ElementUtil.java

Link to comment
Share on other sites

I don't see anything related to tooltips, mass or any other information in your ItemElement class. Are you sure you pushed your latest changes to GitHub?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

6 minutes ago, diesieben07 said:

The text "mass" does not appear once in your item class. Where are you trying to add a tooltip for mass? Please link specific lines.

https://github.com/hamhub7/LabDay/blob/master/src/main/java/com/hamhub7/labday/item/ItemElement.java#L78

I think the error is probably somewhere in here though

https://github.com/hamhub7/LabDay/blob/master/src/main/java/com/hamhub7/labday/util/ElementUtil.java#L441

Link to comment
Share on other sites

Your ElementUtil is a very weird mix of static and singleton. And you never call ElementUtil#init as far as I can see.

All of this is a terrible idea. You should also seriously consider making a dedicated class that stores all the properties for an element instead of spreading them out over separate data structures.

Link to comment
Share on other sites

the init is called in the main class during the init registry. The problem is the large amount of elements (118) so all the elementutil file does is create lists to store all the data, which is then called by the tooltip and other things in the future. I dont know why the list for weight isn't working, because i almost copied and pasted the boiling/melting point one that works. Is there some sort of problem by using an integer instead of a float?

Link to comment
Share on other sites

1 minute ago, Hamhub7 said:

the init is called in the main class during the init registry.

No, it is not. Your main class calls ElementUtil#addTemps, not init.

 

2 minutes ago, Hamhub7 said:

The problem is the large amount of elements (118) so all the elementutil file does is create lists to store all the data, which is then called by the tooltip and other things in the future. I dont know why the list for weight isn't working, because i almost copied and pasted the boiling/melting point one that works. Is there some sort of problem by using an integer instead of a float?

I don't really know how any of this is relevant. Were you referring to my hint about using a separate class? If so, still not sure what your reply means in this context.

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
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.

 Share



×
×
  • Create New...

Important Information

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