src/main/java/com/davidcubesvk/repairItem/utils/Repairer.java
/**
     * Repairs the armor.
     *
     * @param player the player to run the repair for
     * @return the repair result
     */
Repairs the armor.
@param player the player to run the repair for
@return the repair result
Repairs the armor . @param player the player to run the repair for @return the repair result
public RepairResult repairArmor(Player player) {
        ItemStack[] armor = player.getInventory().getArmorContents();
        byte repaired = 0;
        for (int slot : ARMOR_RANGE.getContents())
            repaired += repairItem(armor[slot]).getRepaired();
        return new RepairResult(repaired > 0 ? RepairResult.Status.SUCCESS : RepairResult.Status.FAIL_GENERALIZED, repaired);
    }
public RepairResult repairArmor ( Player player ) { ItemStack [ ] armor = player . getInventory ( ) . getArmorContents ( ) ; byte repaired = 0 ; for ( int slot : ARMOR_RANGE . getContents ( ) ) repaired += repairItem ( armor [ slot ] ) . getRepaired ( ) ; return new RepairResult ( repaired > 0 ? RepairResult . Status . SUCCESS : RepairResult . Status . FAIL_GENERALIZED , repaired ) ; }
Repairs the armor.
Repairs the armor .
//The armor contents //Amount of repaired items //Go through all items //Repair and count the repaired items //Return