Skip to content

Conversation

@MCTian-mi
Copy link
Contributor

@MCTian-mi MCTian-mi commented Nov 10, 2025

What

Replaced the hardcoded check in MetaItem#getModelIndex(ItemStack) with a call to a specific IItemComponent from the metaValueItem, makin it easier to add items with multiple models.

Implementation Details

  • IItemModelDispatcher was added as a child interface of IItemComponent, with a single method getModelIndex(ItemStack, int)
  • A field named `` was added to MetaValueItem to store the model dispatcher, pretty much the same as other special `IItemComponent`s
  • MetaItem#getModelIndex(ItemStack) now calls MetaValueItem#getItemModelDispatcher() and then IItemModelDispatcher#getModelIndex(ItemStack, int)
  • Original hardcoded checks for IElectricItem and IntCircuitIngredient are moved to new impl.

@MCTian-mi MCTian-mi marked this pull request as ready for review November 10, 2025 10:10
@MCTian-mi MCTian-mi requested a review from a team as a code owner November 10, 2025 10:10
MCTian-mi added a commit to MCTian-mi/SussyPatches that referenced this pull request Nov 10, 2025
might move this to the api package later
@M-W-K M-W-K added the type: feature New feature or request label Nov 10, 2025
@ALongStringOfNumbers ALongStringOfNumbers merged commit 81aba54 into GregTechCEu:master Nov 13, 2025
3 checks passed
@MCTian-mi MCTian-mi deleted the model-dispatcher branch November 13, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants