From 10b866f2fa68797b4a1f2eb569b9add34cf92656 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 14:13:04 +0200 Subject: [PATCH] Render used crucifix correctly regardless of used hand --- .../teamlapen/vampirism/client/renderer/RenderHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java b/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java index 9ee2b150d3..5d1bfb6f8d 100644 --- a/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java +++ b/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java @@ -244,9 +244,10 @@ public void onRenderLivingPre(RenderLivingEvent.@NotNull Pre 0) { - if (player.getMainHandItem().getItem() instanceof CrucifixItem) { - int i = player.getMainArm() == HumanoidArm.RIGHT ? 1 : -1; + if (player != null && player.isUsingItem() && player.getUseItemRemainingTicks() > 0 && event.getHand() == player.getUsedItemHand()) { + if (event.getItemStack().getItem() instanceof CrucifixItem) { + HumanoidArm humanoidarm = event.getHand() == InteractionHand.MAIN_HAND ? player.getMainArm() : player.getMainArm().getOpposite(); + int i = humanoidarm == HumanoidArm.RIGHT ? 1 : -1; event.getPoseStack().translate(((float) -i * 0.56F), -0.0, -0.2F); } }