Skip to content

Add API to group items together for the smeltery in NEI#278

Open
tiffit wants to merge 6 commits intoGTNewHorizons:masterfrom
tiffit:smelting-groups
Open

Add API to group items together for the smeltery in NEI#278
tiffit wants to merge 6 commits intoGTNewHorizons:masterfrom
tiffit:smelting-groups

Conversation

@tiffit
Copy link
Copy Markdown

@tiffit tiffit commented Apr 29, 2026

Items can now be assigned a "smelting group." Items in the same smelting group will show up as a single recipe in NEI.

Smelting groups are meant to be as backwards-compatible as possible. It is an extra layer put on top rather than changing the existing smelting recipe format.

Smelting groups are stored as integers internally to improve lookup speed and reduce memory usage.

In GTNH, each ore has multiple stone types and each of these has its own recipe in NEI. With this, we can combine all "iron ore" for example into a single recipe to de-clutter the category.

image image

private int nextSmeltingGroupIndex = 0;
private final Map<String, Integer> smeltingGroupIndexList = new HashMap<>();
private final Map<ItemMetaWrapper, Integer> smeltingGroupIdList = new HashMap<>();
private final Map<Integer, List<ItemMetaWrapper>> smeltingGroupList = new HashMap<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have seen a lot of specialized types used when working with int to avoid boxing the integer but don't know if that is important here (and similarly elsewhere where Set<Integer> is used)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I dont think it will hurt. I moved all the maps and sets over to a fastutils impl

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.

3 participants