Skip to content

Add support for baking multiple models in the standalone API #2135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.21.x
Choose a base branch
from

Conversation

SquidDev
Copy link
Contributor

The current standalone model API currently is designed around baking a single model, loaded from the resource pack. However, Minecraft's other model APIs (e.g. ItemModel.Unbaked) work differently, with consumers being responsible for marking dependencies, fetching model(s) from the bakery, and baking them.

This adds similar support to the standalone model system, with the addition of a new interface.

public interface UnbakedStandaloneModel<T> extends ResolvableModel {
    T bake(ModelBaker baker);
}

This allows mods to implement dynamic models for their modded game content, in the style of ItemModel. See this discussion on Discord for more context.

In the future it would make sense to remove the modelId from StandaloneModelKey (as it is no longer tied to a single model), and have an API closer to Fabric's (FabricMC/fabric#4565). I've not done so for now, as it felt like an unnecessary breaking change, but happy to do so now if preferred!

@neoforged-automation neoforged-automation bot added the 1.21.5 Targeted at Minecraft 1.21.5 label Apr 13, 2025
@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@SquidDev SquidDev changed the title Add support for backing multiple models in the standalone API Add support for baking multiple models in the standalone API Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.5 Targeted at Minecraft 1.21.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant