content: package com.github.alexthe666.rats.client.model.hats;
  
  import net.minecraft.client.model.HumanoidModel;
  import net.minecraft.client.model.geom.ModelPart;
  import net.minecraft.client.renderer.RenderType;
  import net.minecraft.resources.ResourceLocation;
  import net.minecraft.world.entity.LivingEntity;
  import net.minecraft.world.entity.decoration.ArmorStand;
  
  import java.util.function.Function;
  
  public class AbstractHatModel extends HumanoidModel<LivingEntity> {
  
  	public AbstractHatModel(ModelPart root) {
  		super(root);
  	}
  
  	public AbstractHatModel(ModelPart root, Function<ResourceLocation, RenderType> function) {
  		super(root, function);
  	}
  
  	@Override
  	public void setupAnim(LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
  		if (entity instanceof ArmorStand entityarmorstand) {
  			this.head.xRot = 0.017453292F * entityarmorstand.getHeadPose().getX();
  			this.head.yRot = 0.017453292F * entityarmorstand.getHeadPose().getY();
  			this.head.zRot = 0.017453292F * entityarmorstand.getHeadPose().getZ();
  			this.head.setPos(0.0F, 1.0F, 0.0F);
  			this.body.xRot = 0.017453292F * entityarmorstand.getBodyPose().getX();
  			this.body.yRot = 0.017453292F * entityarmorstand.getBodyPose().getY();
  			this.body.zRot = 0.017453292F * entityarmorstand.getBodyPose().getZ();
  			this.leftArm.xRot = 0.017453292F * entityarmorstand.getLeftArmPose().getX();
  			this.leftArm.yRot = 0.017453292F * entityarmorstand.getLeftArmPose().getY();
  			this.leftArm.zRot = 0.017453292F * entityarmorstand.getLeftArmPose().getZ();
  			this.rightArm.xRot = 0.017453292F * entityarmorstand.getRightArmPose().getX();
  			this.rightArm.yRot = 0.017453292F * entityarmorstand.getRightArmPose().getY();
  			this.rightArm.zRot = 0.017453292F * entityarmorstand.getRightArmPose().getZ();
  			this.leftLeg.xRot = 0.017453292F * entityarmorstand.getLeftLegPose().getX();
  			this.leftLeg.yRot = 0.017453292F * entityarmorstand.getLeftLegPose().getY();
  			this.leftLeg.zRot = 0.017453292F * entityarmorstand.getLeftLegPose().getZ();
  			this.leftLeg.setPos(1.9F, 11.0F, 0.0F);
  			this.rightLeg.xRot = 0.017453292F * entityarmorstand.getRightLegPose().getX();
  			this.rightLeg.yRot = 0.017453292F * entityarmorstand.getRightLegPose().getY();
  			this.rightLeg.zRot = 0.017453292F * entityarmorstand.getRightLegPose().getZ();
  			this.rightLeg.setPos(-1.9F, 11.0F, 0.0F);
  			this.hat.copyFrom(this.head);
  		} else {
  			super.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
  		}
  	}
  }
  