From 77584ea2faad8aed302253a22464cdcc29b5d646 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 10 Apr 2023 16:55:41 +0200 Subject: [PATCH] Fixed levitating item placement in third person and fixed crowssbow positioning --- .../minelittlepony/client/render/LevitatingItemRenderer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java index cd8af3dc..7a7a4969 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -14,6 +14,7 @@ import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.CrossbowItem; import net.minecraft.item.ItemStack; import net.minecraft.screen.PlayerScreenHandler; import net.minecraft.util.Arm; @@ -62,7 +63,7 @@ public class LevitatingItemRenderer { boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic.get() && pony.hasMagic(); - if (doMagic) { + if (doMagic && mode.isFirstPerson()) { setupPerspective(itemRenderer, entity, stack, left, matrix); } @@ -91,7 +92,7 @@ public class LevitatingItemRenderer { private void setupPerspective(ItemRenderer renderer, LivingEntity entity, ItemStack item, boolean left, MatrixStack stack) { UseAction action = item.getUseAction(); - boolean doNormal = entity.getItemUseTime() <= 0 || action == UseAction.NONE || action == UseAction.CROSSBOW; + boolean doNormal = entity.getItemUseTime() <= 0 || action == UseAction.NONE || (action == UseAction.CROSSBOW && CrossbowItem.isCharged(item)); if (doNormal) { // eating, blocking, and drinking are not transformed. Only held items. int sign = left ? 1 : -1;