neoforged / Documentation

The repository containing Neo's documentation
MIT License
23 stars 35 forks source link

Creative Category sorting methods don't work #112

Closed KekeCreations closed 2 weeks ago

KekeCreations commented 2 weeks ago

My code for sorting creative categories, this should work yet it doesn't

`private void addAfter(BuildCreativeModeTabContentsEvent event, Item beforeItem, Item item) { event.getEntries().putAfter(beforeItem.getDefaultInstance(), item.getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); } private void addAfter(BuildCreativeModeTabContentsEvent event, Block beforeItem, Item item) { event.getEntries().putAfter(beforeItem.asItem().getDefaultInstance(), item.getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); } private void addAfter(BuildCreativeModeTabContentsEvent event, Item beforeItem, Block item) { event.getEntries().putAfter(beforeItem.getDefaultInstance(), item.asItem().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); } private void addAfter(BuildCreativeModeTabContentsEvent event, Block beforeItem, Block item) { event.getEntries().putAfter(beforeItem.asItem().getDefaultInstance(), item.asItem().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); } private void addBefore(BuildCreativeModeTabContentsEvent event, Block beforeItem, Block item) { event.getEntries().putBefore(beforeItem.asItem().getDefaultInstance(), item.asItem().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); } private void addBefore(BuildCreativeModeTabContentsEvent event, Item beforeItem, Item item) { event.getEntries().putBefore(beforeItem.getDefaultInstance(), item.getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); }

public void creativeItemGroups(BuildCreativeModeTabContentsEvent event) {
    if (event.getTabKey() == CreativeModeTabs.COLORED_BLOCKS) {
        addAfter(event, Blocks.PINK_GLAZED_TERRACOTTA, KekeBlocks.TERRACOTTA_SHINGLES.get());
        addAfter(event, KekeBlocks.TERRACOTTA_SHINGLES.get(), KekeBlocks.TERRACOTTA_SHINGLE_STAIRS.get());
        addAfter(event, KekeBlocks.TERRACOTTA_SHINGLE_STAIRS.get(), KekeBlocks.TERRACOTTA_SHINGLE_SLAB.get());
        addAfter(event, KekeBlocks.TERRACOTTA_SHINGLE_SLAB.get(), KekeBlocks.TERRACOTTA_SHINGLE_WALL.get());

}`

Result is items being the correct category but unsorted image

I asked someone for help to see if my code was the issue and they said this! image

image

KekeCreations commented 2 weeks ago

I can't add tags for some reason?