package com.r3944realms.leashedplayer.client.renderer;

import net.minecraft.client.renderer.entity.state.EntityRenderState;
import net.minecraft.util.Mth;
import net.minecraft.world.phys.Vec3;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;

import javax.annotation.Nullable;

@OnlyIn(Dist.CLIENT)
public class PlayerLeashState {
    public Vec3 o, pos, offset;
    public float yRotO, yRot;
    public float eyeHeight;
    public int startBlockLight;
    public int endBlockLight;
    public int startSkyLight;
    public int endSkyLight;
    @Nullable
    public EntityRenderState.LeashState vanilaLeashState;

    public float getPreciseBodyRotation(float pPartialTick) {
        return Mth.lerp(pPartialTick, this.yRotO, this.yRot);
    }


    public PlayerLeashState() {
        this.offset = Vec3.ZERO;
        this.o = Vec3.ZERO;
        this.pos = Vec3.ZERO;
        this.yRot = 0.0f;
        this.yRotO = 0.0f;
        this.eyeHeight = 0.0f;
        this.startBlockLight = 0;
        this.endBlockLight = 0;
        this.startSkyLight = 15;
        this.endSkyLight = 15;
        this.vanilaLeashState = null;
    }
}
