Skip to content
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

[1.21.3] Expose vanilla model generators for modded usages #1696

Draft
wants to merge 33 commits into
base: 1.21.x
Choose a base branch
from

Conversation

ApexModder
Copy link
Contributor

@ApexModder ApexModder commented Nov 22, 2024

This PR allows modders to make use of the vanilla model generators and all the helpers/utilities that come with them.
This is done by adding methods which modders must override in each of the main data providers, failing to override these methods will result in vanilla models being generated.

Various ResourceLocation.withDefaultNamespace calls have also been patched to now call ResourceLocation.parse, this is to support passing in paths with modded namespaces.

With 1.21.4 and all of its model changes, this is intended as a stepping point towards using the vanilla generators. Rather than having to patch and potentially rewrite ours to support all these changes.

TODO

  • Add ExistingFileHelper support, validate referenced textures and parent models exist
  • Expand ModelBuilder to pass its output to ItemModelOutput, allowing modders to build custom models
  • Support our RenderType and face data extensions when using template models
    • Unsure if mutating face data is possible using model templates
  • Generate texture animation mcmeta files?
  • Validate that added ATs are still needed after recent changes.

Original conversation can be found in NeoCord

@ApexModder ApexModder added the 1.21.3 Targeted at Minecraft 1.21.3 label Nov 22, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Nov 22, 2024

  • Publish PR to GitHub Packages

Last commit published: 937460d091f56548d8fdb84b6fc03bcf5b9719ba.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1696' // https://github.com/neoforged/NeoForge/pull/1696
        url 'https://prmaven.neoforged.net/NeoForge/pr1696'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1696.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1696
cd NeoForge-pr1696
curl -L https://prmaven.neoforged.net/NeoForge/pr1696/net/neoforged/neoforge/21.3.73-beta-pr-1696-pr-vanilla-data-gen/mdk-pr1696.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@ApexModder ApexModder added 1.21.4 Targeted at Minecraft 1.21.4 and removed 1.21.3 Targeted at Minecraft 1.21.3 labels Nov 23, 2024
Expose everything from ItemModelGenerators and BlockModelGenerators
Support modded paths in ModelTemplate.create
Allow setting render types for model templates
Allow setting custom data from TexturedModel
Allow specifying render typed by strings (defaulting to "minecraft" namespace)
Add mod and minecraft model path helpers
Fix block models generating empty content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants