Skip to content

Fix CreativeCategory api#8665

Closed
Machine-Maker wants to merge 1 commit intoPaperMC:masterfrom
Machine-Maker:fix/creativecategory-api
Closed

Fix CreativeCategory api#8665
Machine-Maker wants to merge 1 commit intoPaperMC:masterfrom
Machine-Maker:fix/creativecategory-api

Conversation

@Machine-Maker
Copy link
Copy Markdown
Member

@Machine-Maker Machine-Maker commented Dec 13, 2022

Probably in the future this should be expanded to get all itemstacks in a specific category. It's not perfect system since ItemStacks are in categories now, so also a method to check if an ItemStack is in a specific category would be nice.


Fixes #8770

@Machine-Maker Machine-Maker requested a review from a team as a code owner December 13, 2022 21:03
Copy link
Copy Markdown
Member

@Owen1212055 Owen1212055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work?
Tested and it always returns an empty set.

@Machine-Maker Machine-Maker force-pushed the fix/creativecategory-api branch from 76e85a5 to 7a238f2 Compare December 23, 2022 18:13
@Machine-Maker
Copy link
Copy Markdown
Member Author

It'd help if I actually pushed from my local repo...

@AlmightyAnubis
Copy link
Copy Markdown

Would also be nice if the Materials in the Material Enum would be sortet the way the new search tab in the creativ inventory is sortet. So the wood is grouped etc.

@Machine-Maker
Copy link
Copy Markdown
Member Author

Machine-Maker commented May 24, 2023

The material enum is most likely being deprecated either for 1.20 or the next major update, not really worth it.

Even so, I don't really think the order of fields is important at all. Also, some materials are in multiple categories, so not sure how that would factor into the field order.

@AlmightyAnubis
Copy link
Copy Markdown

In the search bar, more or less all items are contained. And they are sortet in the new way, which is much more convinient. When I list items, I would really like this way of order over the old one.
image

@Machine-Maker Machine-Maker force-pushed the fix/creativecategory-api branch from 7a238f2 to e9a584f Compare May 25, 2023 22:44
@Machine-Maker Machine-Maker force-pushed the fix/creativecategory-api branch from e9a584f to 38c83f7 Compare June 24, 2023 00:56
+@DefaultQualifier(NonNull.class)
+public final class PaperCreativeCategory {
+
+ public static final List<CreativeModeTab> BLOCK_TABS = CreativeModeTabs.allTabs().stream().filter(tab -> tab.getType() == CreativeModeTab.Type.CATEGORY).toList();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreativeModeTabs#streamAllTabs can be used here

@KodingDev
Copy link
Copy Markdown

Hey, any updates on this? Can't really fallback to the existing implementation since it's just a constant for all items.

@NonSwag
Copy link
Copy Markdown
Contributor

NonSwag commented Nov 25, 2024

Hey, any updates on this? Can't really fallback to the existing implementation since it's just a constant for all items.

Iirc the creative categories are deprecated since they no longer exist on the server

@KodingDev
Copy link
Copy Markdown

Gotcha, any way we could semi mimic it with tags? That's about the only half-baked solution that's really worked for us

@electronicboy
Copy link
Copy Markdown
Member

Mojang now stores this stuff in a registry on the server, the old method will be deprecated because things can be in more than 1 tab, though

@Warriorrrr Warriorrrr moved this from Awaiting final testing to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch PaperMC:master March 23, 2025 19:15
@kennytv kennytv closed this Mar 23, 2025
@Machine-Maker Machine-Maker removed the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Feb 28, 2026
@Machine-Maker Machine-Maker deleted the fix/creativecategory-api branch February 28, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

getCreativeCategory() doesn't work correctly

9 participants