Hotfix for 1.19.2 item animation bug (#8987)

* [HOT FIX]: Fixes #8985 by no-oping for vanilla models instead of throwing error

Signed-off-by: tmvkrpxl0 <[email protected]>
This commit is contained in:
한현빈 authored and GitHub committed 2022-08-20 11:38:24 +02:00
1 parent c0aa8dd808
commit b5d5855559
3 files changed
+7 -3

No files matched your search

@@ -27,7 +27,7 @@
EMPTY(false),
ITEM(false),
BLOCK(false),
@@ -411,10 +_,30 @@
@@ -411,10 +_,29 @@
private ArmPose(boolean p_102896_) {
this.f_102890_ = p_102896_;
@@ -52,8 +52,7 @@
+ }
+
+ public <T extends LivingEntity> void applyTransform(HumanoidModel<T> model, T entity, net.minecraft.world.entity.HumanoidArm arm) {
+ com.google.common.base.Preconditions.checkNotNull(this.forgeArmPose, "applyTransform() must not be called on a vanilla ArmPose!");
+ this.forgeArmPose.applyTransform(model, entity, arm);
+ if (this.forgeArmPose != null) this.forgeArmPose.applyTransform(model, entity, arm);
+ }
+ // FORGE END
}
@@ -92,6 +92,9 @@ public class ItemUseAnimationTest
@Override
public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {
applyItemArmTransform(poseStack, arm);
if (player.getUseItem() != itemInHand) {
return true;
}
if (player.isUsingItem()) {
poseStack.translate(0.0, -0.05, 0.0);
}
+2
View File
@@ -248,6 +248,8 @@ modId="anvil_update_event_fix"
modId="item_use_animation_test"
[[mods]]
modId="custom_color_resolver_test"
[[mods]]
modId="custom_item_decorations_test"