Jump to content

[SOLVED] [1.7.10] Quick Questions


Pancake

Recommended Posts

Greetings!

 

 

some quick questions, regarding efficiency.

 

1) I try to get a list of all the items. Is this an efficient way?

GameData.getItemRegistry().getKeys()

 

2) for each String s in that set, I do [1] to get an Item Object. To get the display name (not the unlocalised name, I want the name it shows the user, is it necessary to make a new ItemStack with that item, and do [2] or can it be retrieved from the item directly? I couldn't find anything in the Item class.

 

[1]

GameData.getItemRegistry().getObject(s)

[2]

stack.getDisplayName()

 

That's all for now. I might edit this post and bump this thread if I have more relatively easy problems.

 

 

Thanks in advance,

Pancake.

 

 

EDIT: about (2) ... I just remembered Items can have metadata, and one metadata of an item can have a different name than another metadata. I'll just make the list of items based on the output of all the recipes. Thanks anyways... for reading and silently judging me.

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.



×
×
  • Create New...

Important Information

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