Skip to content

Cleanup getModItem#1646

Open
Nikolay-Sitnikov wants to merge 6 commits intomasterfrom
cleanup-get-mod-item
Open

Cleanup getModItem#1646
Nikolay-Sitnikov wants to merge 6 commits intomasterfrom
cleanup-get-mod-item

Conversation

@Nikolay-Sitnikov
Copy link
Contributor

@Nikolay-Sitnikov Nikolay-Sitnikov commented Mar 13, 2026

Cleans up the behavior of getModItem and the missing item fire.

Changes:

  • GTModHandler.getModItem is no longer used, instead the new class IngredientFactory implements it.
  • No more passing around missing into every call of getModItem
  • createItemStack has been moved from IScriptLoader to IngredientFactory
  • All usages of getModItem have been converted to static imports.
  • getModItem no longer takes in longs, since ItemStacks can't go above int anyways.
  • getModItem will create a custom fire item with a name that indicates the missing item when the dreamcraft.debug.recipe system property is set to true. The property is set by default in the development environment.

Also, getModItem is now much more optimized, with two less ItemStack copy operations per call and one less array allocation per call.

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.

1 participant