Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update StorageBlockListSettingScreen.java to use reflection #4675

Closed

Conversation

tympanicblock61
Copy link
Contributor

How Has This Been Tested?

me

Checklist:

  • [ maybe] My code follows the style guidelines of this project.
  • [ nope] I have added comments to my code in more complex areas.
  • [ yes] I have tested the code in both development and production environments.

accept this if you want i dont really care

@MineGame159
Copy link
Member

Opened the code to check it out but I got an idea that could be much better than reflection. The BlockEntityType class contains a set of Blocks. So we could just get the block from that set, get the item for the block and create the name from it's id. The only problem are shulker boxes, since those are the only block entities that have more blocks associated with the type because of colors. So there would have to be special code for that to make sure it picks the one without a color. But imo it would be a nicer approach than reflection which depends on the development mappings.

@tympanicblock61 tympanicblock61 closed this by deleting the head repository Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants