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

[1.21] Creative Category sorting methods don't work #1119

Open
KekeCreations opened this issue Jun 16, 2024 · 1 comment · May be fixed by #1156
Open

[1.21] Creative Category sorting methods don't work #1119

KekeCreations opened this issue Jun 16, 2024 · 1 comment · May be fixed by #1156
Assignees
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error

Comments

@KekeCreations
Copy link

Minecraft Version: {Minecraft version. *1.21}

NeoForge Version: {NeoForge version. 21.0.0-beta,}

Steps to Reproduce:

  1. Create an item
  2. Try and put it in a vanilla creative category with addafter or addbefore
  3. boot up the game

Description of issue:
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 KekeCreations added the triage Needs triaging and confirmation label Jun 16, 2024
@TelepathicGrunt
Copy link
Contributor

Linking the other previous issue report for reference
#1040
#886

@TelepathicGrunt TelepathicGrunt self-assigned this Jun 21, 2024
@TelepathicGrunt TelepathicGrunt added bug A bug or error 1.21 Targeted at Minecraft 1.21 and removed triage Needs triaging and confirmation labels Jun 21, 2024
TelepathicGrunt added a commit to TelepathicGrunt/NeoForge that referenced this issue Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error
Projects
None yet
2 participants