Jump to content

[1.16.4]Items don't appear in alphabetical order in custom menu


Cratthorax

Recommended Posts

Good morning,

as by title, I made sure all objects and related content(textures, database files, registry etc.) are sorted alphabetically, yet they randomly do not appear in the menu like that. I would use terminology like this, to make sure I would also get a sorting by item type:

...gravelantimony, gravelcopper, gravelgold...gravelroastedantimony, gravelroastedcopper, gravelroastediron...ingotantimony, ingotbronze, ingotcopper...etc. etc. etc.

This is how it looks in the menu, obviously not sorted the way I'd like to see it. The gravels are mixed with some of the ingots, and some of the blocks should be sorted into ores/rocks etc.:

sorting.jpg

The fill method in ItemGroup.class has deprecated content:

	   /**
    * Fills {@code items} with all items that are in this group.
    */
   @OnlyIn(Dist.CLIENT)
   public void fill(NonNullList<ItemStack> items) {
      for(Item item : Registry.ITEM) { //.ITEM is deprecated
         item.fillItemGroup(this, items);
      }
	   }

Any relation?

Edited by Cratthorax
Link to comment
Share on other sites

18 hours ago, diesieben07 said:

You can override the fill method in your item group and sort the list if you want to have it sorted regardless of mods being added or removed from the world.

Yeah, thanks for the help. Googling I found traces of custom item groups. But again, I would always search for methods with very low scope to prevent code bloat. I'd end up most of the time developing something myself, which usually takes ages. As stated before in another thread, it's quite hard to cover all the cross references specially if you're working with a huge project.

Just a couple of links to give the thread purpose, if anyone shows up here googling for the same problem. They didn't conveniently fixed the issue I was having, which turned out to be a non issue.

 

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