content: package com.alrex.parcool.mixin.client;
  
  import com.alrex.parcool.common.capability.Parkourability;
  import net.minecraft.client.renderer.entity.EntityRenderer;
  import net.minecraft.client.renderer.entity.EntityRendererManager;
  import net.minecraft.client.renderer.entity.IEntityRenderer;
  import net.minecraft.client.renderer.entity.LivingRenderer;
  import net.minecraft.client.renderer.entity.model.EntityModel;
  import net.minecraft.entity.LivingEntity;
  import net.minecraft.entity.player.PlayerEntity;
  import org.spongepowered.asm.mixin.Mixin;
  import org.spongepowered.asm.mixin.injection.At;
  import org.spongepowered.asm.mixin.injection.Inject;
  import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
  
  @Mixin(LivingRenderer.class)
  public abstract class LivingRendererMixin<T extends LivingEntity, M extends EntityModel<T>> extends EntityRenderer<T> implements IEntityRenderer<T, M> {
      protected LivingRendererMixin(EntityRendererManager p_i46179_1_) {
          super(p_i46179_1_);
      }
  
      @Inject(method = "shouldShowName(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("HEAD"), cancellable = true)
      protected void onShouldShowName(T entity, CallbackInfoReturnable<Boolean> cir) {
          if (entity instanceof PlayerEntity) {
              PlayerEntity player = (PlayerEntity) entity;
              Parkourability parkourability = Parkourability.get(player);
              if (parkourability == null) return;
              if (parkourability.getBehaviorEnforcer().cancelShowingName()) {
                  cir.setReturnValue(false);
              }
          }
      }
  
  }
  