public void func_82399_a(
      EntityWitherSkull par1EntityWitherSkull,
      double par2,
      double par4,
      double par6,
      float par8,
      float par9) {
    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);
    float f2 =
        this.func_82400_a(
            par1EntityWitherSkull.prevRotationYaw, par1EntityWitherSkull.rotationYaw, par9);
    float f3 =
        par1EntityWitherSkull.prevRotationPitch
            + (par1EntityWitherSkull.rotationPitch - par1EntityWitherSkull.prevRotationPitch)
                * par9;
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    float f4 = 0.0625F;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    if (par1EntityWitherSkull.isInvulnerable()) {
      this.loadTexture("/mob/wither_invul.png");
    } else {
      this.loadTexture("/mob/wither.png");
    }

    this.skeletonHeadModel.render(par1EntityWitherSkull, 0.0F, 0.0F, 0.0F, f2, f3, f4);
    GL11.glPopMatrix();
  }
  @Override
  public ItemStack onItemRightClick(
      ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
    PropertyDoom doom = PropertyDoom.get(par3EntityPlayer);

    Vec3 vec = WorldHelper.getVecFromEntity(par3EntityPlayer);
    if (vec == null) return par1ItemStack;

    if (doom != null && !par2World.isRemote && getStackCooldown(par1ItemStack) == 0) {
      double d4 = vec.xCoord - par3EntityPlayer.posX;
      double d5 = vec.yCoord - (par3EntityPlayer.posY + par3EntityPlayer.height / 2.0F);
      double d6 = vec.zCoord - par3EntityPlayer.posZ;

      if (!par3EntityPlayer.isSneaking()) {
        if (canUseAbility(doom, TragicConfig.doomAbilityCost[35]) && TragicConfig.doomAbility[35]) {
          if (!par3EntityPlayer.capabilities.isCreativeMode)
            doom.increaseDoom(-TragicConfig.doomAbilityCost[35]);
          setStackCooldown(par1ItemStack, 5);

          EntityWitherSkull skull = new EntityWitherSkull(par2World, par3EntityPlayer, d4, d5, d6);
          skull.posY += par3EntityPlayer.getEyeHeight();
          par2World.spawnEntityInWorld(skull);
          return par1ItemStack;
        }
      } else {
        if (canUseAbility(doom, TragicConfig.doomAbilityCost[36]) && TragicConfig.doomAbility[36]) {
          if (!par3EntityPlayer.capabilities.isCreativeMode)
            doom.increaseDoom(-TragicConfig.doomAbilityCost[36]);
          setStackCooldown(par1ItemStack, 5);

          EntityWitherSkull skull = new EntityWitherSkull(par2World, par3EntityPlayer, d4, d5, d6);
          skull.posY += par3EntityPlayer.getEyeHeight();
          skull.setInvulnerable(true);
          par2World.spawnEntityInWorld(skull);
          return par1ItemStack;
        }
      }
    }

    return par1ItemStack;
  }
  private void func_82209_a(
      int p_82209_1_, double p_82209_2_, double p_82209_4_, double p_82209_6_, boolean p_82209_8_) {
    this.worldObj.playAuxSFXAtEntity(
        (EntityPlayer) null, 1014, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
    double d3 = this.func_82214_u(p_82209_1_);
    double d4 = this.func_82208_v(p_82209_1_);
    double d5 = this.func_82213_w(p_82209_1_);
    double d6 = p_82209_2_ - d3;
    double d7 = p_82209_4_ - d4;
    double d8 = p_82209_6_ - d5;
    EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d6, d7, d8);

    if (p_82209_8_) {
      entitywitherskull.setInvulnerable(true);
    }

    entitywitherskull.posY = d4;
    entitywitherskull.posX = d3;
    entitywitherskull.posZ = d5;
    this.worldObj.spawnEntityInWorld(entitywitherskull);
  }
 public void onPlayerStoppedUsing(
     ItemStack par1ItemStack, World world, EntityPlayer entityplayer, int par4) {
   par1ItemStack.damageItem(27, entityplayer);
   entityplayer.addExhaustion(5.0F);
   world.playSoundAtEntity(
       entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
   if (!world.isRemote) {
     Vec3 look = entityplayer.getLookVec();
     EntityWitherSkull fireball2 = new EntityWitherSkull(world, entityplayer, 1.0D, 1.0D, 1.0D);
     fireball2.setPosition(
         entityplayer.posX + look.xCoord * 1.0D,
         entityplayer.posY
             + look.yCoord
             + (double) entityplayer.getEyeHeight()
             - 0.10000000149011612D,
         entityplayer.posZ + look.zCoord * 1.0D);
     fireball2.accelerationX = look.xCoord * 0.1D;
     fireball2.accelerationY = look.yCoord * 0.1D;
     fireball2.accelerationZ = look.zCoord * 0.1D;
     world.spawnEntityInWorld(fireball2);
   }
 }