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

Prototype of dispatched UnbakedModel serializers #1557

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

Conversation

FiniteReality
Copy link
Member

Blame @XFactHD for making me work on this 😆

This is a prototype of a potential alternative to Neo's current model loading extension to allow custom implementations of UnbakedModel instead of stapling an IUnbakedGeometry onto BlockModel. I've been theorycrafting this for a while, hinting that I wanted to get rid of IUnbakedGeometry and what feels like a bunch of legacy cruft, but this is the first real step in that direction.

Pros:

  • No more weird IUnbakedGeometry codepaths
  • Simpler* implementation (in my opinion 😛)
  • Registering custom model loaders only requires registering a codec for a custom subclass
  • Parent model references using custom model types Just Work

Cons:

  • Codecs slow (Codecs are only used on resource reload, so it shouldn't be TOO bad?)
  • More patches (at least until we find a better way to change generic types)
  • Slightly harder to maintain (at least until Mojang codec-ifies their own models)

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Sep 20, 2024

  • Publish PR to GitHub Packages

Last commit published: d84a372eeabd54d6581000f38a5185c15f9518a1.

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 #1557' // https://github.com/neoforged/NeoForge/pull/1557
        url 'https://prmaven.neoforged.net/NeoForge/pr1557'
        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-pr1557.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1557
cd NeoForge-pr1557
curl -L https://prmaven.neoforged.net/NeoForge/pr1557/net/neoforged/neoforge/21.1.59-pr-1557-feature-block-models-unbaked/mdk-pr1557.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.

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