예제 #1
0
  public void renderPlayer(
      EntityPlayer par1EntityPlayer,
      double par2,
      double par4,
      double par6,
      float par8,
      float par9) {
    ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
    modelArmorChestplate.heldItemRight =
        modelArmor.heldItemRight = modelBipedMain.heldItemRight = itemstack == null ? 0 : 1;

    if (itemstack != null && par1EntityPlayer.getItemInUseCount() > 0) {
      EnumAction enumaction = itemstack.getItemUseAction();

      if (enumaction == EnumAction.block) {
        modelArmorChestplate.heldItemRight =
            modelArmor.heldItemRight = modelBipedMain.heldItemRight = 3;
      } else if (enumaction == EnumAction.bow) {
        modelArmorChestplate.aimedBow = modelArmor.aimedBow = modelBipedMain.aimedBow = true;
      }
    }

    modelArmorChestplate.isSneak =
        modelArmor.isSneak = modelBipedMain.isSneak = par1EntityPlayer.isSneaking();
    double d = par4 - (double) par1EntityPlayer.yOffset;

    if (par1EntityPlayer.isSneaking() && !(par1EntityPlayer instanceof EntityPlayerSP)) {
      d -= 0.125D;
    }

    super.doRenderLiving(par1EntityPlayer, par2, d, par6, par8, par9);
    modelArmorChestplate.aimedBow = modelArmor.aimedBow = modelBipedMain.aimedBow = false;
    modelArmorChestplate.isSneak = modelArmor.isSneak = modelBipedMain.isSneak = false;
    modelArmorChestplate.heldItemRight =
        modelArmor.heldItemRight = modelBipedMain.heldItemRight = 0;
  }