Prototype of dispatched UnbakedModel serializers
Blame @XFactHD for making me work on this :laughing:
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 :stuck_out_tongue:)
- 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)
- [x] Publish PR to GitHub Packages
Last commit published: d84a372eeabd54d6581000f38a5185c15f9518a1.
PR Publishing
The artifacts published by this PR:
- :package:
net.neoforged:neoforge:21.1.59-pr-1557-feature-block-models-unbaked - :package:
net.neoforged:testframework:21.1.59-pr-1557-feature-block-models-unbaked
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.
@FiniteReality, this pull request has conflicts, please resolve them for this PR to move forward.
Given the lack of activity and the need for a rebase, I'll be closing this PR for now. Feel free to open it again after the conflicts are resolved.