From 6ebed97575baa84741550cbaa0ca08ed70e8aad7 Mon Sep 17 00:00:00 2001 From: MehVahdJukaar Date: Thu, 31 Oct 2024 14:01:11 +0100 Subject: [PATCH] holler funni --- .../galena/doom_and_gloom/client/model/HollerModel.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/galena/doom_and_gloom/client/model/HollerModel.java b/src/main/java/galena/doom_and_gloom/client/model/HollerModel.java index 175cc9eb..9a4846c5 100644 --- a/src/main/java/galena/doom_and_gloom/client/model/HollerModel.java +++ b/src/main/java/galena/doom_and_gloom/client/model/HollerModel.java @@ -3,7 +3,6 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; -import galena.doom_and_gloom.client.ORenderTypes; import galena.doom_and_gloom.content.entity.holler.Holler; import net.minecraft.client.model.EntityModel; import net.minecraft.client.model.HeadedModel; @@ -23,7 +22,7 @@ public class HollerModel extends EntityModel implements Hea private double yHover; private float alphaMult; - private Vec3 posDelta; + private Vec3 prevPosDelta; private float prevRotDelta; public HollerModel(ModelPart root) { @@ -68,7 +67,7 @@ public void prepareMobModel(T entity, float pLimbSwing, float pLimbSwingAmount, // luckily we only rotate on Y. Could be done better on the renderer level // no clue why z needs to be flipped... - posDelta = entity.getPosDelta(pPartialTick) + prevPosDelta = entity.getPosDelta(pPartialTick) .multiply(-1, 1, 1) .yRot(-currentBodyRot * Mth.DEG_TO_RAD); @@ -97,7 +96,7 @@ public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ag public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - double alphaDecayFactor = posDelta.lengthSqr() * 100f; + double alphaDecayFactor = prevPosDelta.lengthSqr() * 100f; alphaDecayFactor = Math.min(alphaDecayFactor, 1); int step = 6; @@ -115,7 +114,7 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i poseStack.pushPose(); //scale trail further back float trailScalar = 4; - var stepDelta = posDelta.scale(i / (float) step * trailScalar); + var stepDelta = prevPosDelta.scale(i / (float) step * trailScalar); poseStack.translate(stepDelta.x, stepDelta.y + yHover, stepDelta.z); poseStack.mulPose(Axis.YN.rotationDegrees(stepYRot * i)); float scale = 1 - (0.3f * i / (float) (step));