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

Add EntityRenderState to IClientItemExtensions#get*ArmorModel #1858

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

Conversation

ChampionAsh5357
Copy link
Contributor

Provides access to the EntityRenderState when calling one of the armor model methods in IClientItemExtensions. This replaces the previous setupModelAnimations and leaves it to the modder to determine whether to use the render state or not.

The EntityRenderState is cached after all modifiers are applied and released after rendering has completed. This method was used to avoid patching every location where EquipmentLayerRenderer#renderLayers is called.

@ChampionAsh5357 ChampionAsh5357 added bug A bug or error rendering Related to rendering triage Needs triaging and confirmation regression Worked previously but doesn't anymore 1.21.4 Targeted at Minecraft 1.21.4 labels Jan 16, 2025
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jan 16, 2025

  • Publish PR to GitHub Packages

Last commit published: ea610c56c3295350a959167a0df47ef6394f5cd7.

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 #1858' // https://github.com/neoforged/NeoForge/pull/1858
        url 'https://prmaven.neoforged.net/NeoForge/pr1858'
        content {
            includeModule('net.neoforged', 'testframework')
            includeModule('net.neoforged', 'neoforge')
        }
    }
}

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-pr1858.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1858
cd NeoForge-pr1858
curl -L https://prmaven.neoforged.net/NeoForge/pr1858/net/neoforged/neoforge/21.4.61-beta-pr-1858-fix-renderstate-in-itemarmor/mdk-pr1858.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.

@neoforged-compatibility-checks

@ChampionAsh5357, this PR introduces breaking changes.
Fortunately, this project is currently accepting breaking changes, but if they are not intentional, please revert them.
Last checked commit: ea610c56c3295350a959167a0df47ef6394f5cd7.

neoforge (:neoforge)

  • net/neoforged/neoforge/client/extensions/common/IClientItemExtensions
    • getGenericArmorModel(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/client/resources/model/EquipmentClientInfo$LayerType;Lnet/minecraft/client/model/Model;)Lnet/minecraft/client/model/Model;: ❗ API method was removed
    • setupModelAnimations(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/entity/EquipmentSlot;Lnet/minecraft/client/model/Model;FFFFFF)V: ❗ API method was removed
    • getHumanoidArmorModel(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/client/resources/model/EquipmentClientInfo$LayerType;Lnet/minecraft/client/model/Model;)Lnet/minecraft/client/model/Model;: ❗ API method was removed

@ChampionAsh5357 ChampionAsh5357 added the breaking change Breaks binary compatibility label Jan 17, 2025
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 breaking change Breaks binary compatibility bug A bug or error regression Worked previously but doesn't anymore rendering Related to rendering triage Needs triaging and confirmation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant