/* * Decompiled with CFR 0.152. * * Could not load the following classes: * org.joml.Quaternionfc */ package net.minecraft.client.renderer.entity; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; import net.minecraft.client.model.EvokerFangsModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.SubmitNodeCollector; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.state.EvokerFangsRenderState; import net.minecraft.client.renderer.state.CameraRenderState; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.Identifier; import net.minecraft.world.entity.projectile.EvokerFangs; import org.joml.Quaternionfc; public class EvokerFangsRenderer extends EntityRenderer { private static final Identifier TEXTURE_LOCATION = Identifier.withDefaultNamespace("textures/entity/illager/evoker_fangs.png"); private final EvokerFangsModel model; public EvokerFangsRenderer(EntityRendererProvider.Context context) { super(context); this.model = new EvokerFangsModel(context.bakeLayer(ModelLayers.EVOKER_FANGS)); } @Override public void submit(EvokerFangsRenderState state, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, CameraRenderState camera) { float biteProgress = state.biteProgress; if (biteProgress == 0.0f) { return; } poseStack.pushPose(); poseStack.mulPose((Quaternionfc)Axis.YP.rotationDegrees(90.0f - state.yRot)); poseStack.scale(-1.0f, -1.0f, 1.0f); poseStack.translate(0.0f, -1.501f, 0.0f); submitNodeCollector.submitModel(this.model, state, poseStack, this.model.renderType(TEXTURE_LOCATION), state.lightCoords, OverlayTexture.NO_OVERLAY, state.outlineColor, null); poseStack.popPose(); super.submit(state, poseStack, submitNodeCollector, camera); } @Override public EvokerFangsRenderState createRenderState() { return new EvokerFangsRenderState(); } @Override public void extractRenderState(EvokerFangs entity, EvokerFangsRenderState state, float partialTicks) { super.extractRenderState(entity, state, partialTicks); state.yRot = entity.getYRot(); state.biteProgress = entity.getAnimationProgress(partialTicks); } }