@Override
  public void execute() {
    if (!player.getInventory().contains(bar.getPrimaryOre())
        || (bar.getSecondaryOre() != null && !player.getInventory().contains(bar.getSecondaryOre()))
        || productionAmount < 1) {
      this.stop();
      Animation.create(-1);
      return;
    }
    fourTickDelay++;
    animationTick++;
    if (animationTick % 5 == 0) {
      player.playAnimation(ANIMATION);
      fourTickDelay = 1;
      if (bar == Bar.GOLD)
        player.getActionSender().sendMessage("You place a lump of gold in the furnace.");
    }
    if (fourTickDelay % 5 != 0) {
      return;
    }
    if (bar == Bar.IRON && random.nextBoolean() && !player.getEquipment().contains(2568)) {
      player.getInventory().remove(bar.primary);
      player.getActionSender().sendMessage("The ore is too impure and you fail to refine it.");
    } else {
      player.getInventory().remove(bar.getPrimaryOre());
      player.getInventory().remove(bar.getSecondaryOre());
      String message = bar.toString().toLowerCase();
      message =
          bar == Bar.GOLD
              ? "You retrieve a lump of gold from the furnace"
              : "You smelt the " + message + " in the furnace.";
      player.getInventory().add(bar.getProduct());
      player.getActionSender().sendMessage(message);
      player.getSkills().addExperience(Skills.SMITHING, bar.getExperience());
    }

    productionAmount--;
  }