Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.