Skip to content

Conversation

@WhitePhant0m
Copy link
Contributor

@WhitePhant0m WhitePhant0m commented Jul 22, 2025

results:
image
image

public class TagsToGenerate {

static final Map<TagKey<Item>, List<ItemLike>> tagToItemMap = new HashMap<>();
static final Map<ItemLike, SortOrder> itemSortOrderMap = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

The key should be Item not ItemLike, otherwise it might not be found in the map if queried with a different ItemLike that has the same Item.

public static void generateTagNoTranslation(TagKey<Item> tag, ItemLike item, SortOrder sortOrder) {
tagToItemMap.computeIfAbsent(tag, t -> new ArrayList<>()).add(item);
if (sortOrder != null) {
itemSortOrderMap.put(item, sortOrder);
Copy link
Contributor

Choose a reason for hiding this comment

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

item.asItem here

generateTagNoTranslation(tag, item, null);
}

public static void generateTagNoTranslation(TagKey<Item> tag, ItemLike item, SortOrder sortOrder) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Make the param @nullable

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