src/main/java/com/davidcubesvk/repairItem/utils/Repairer.java
/**
     * Repairs the hot-bar including both hands.
     *
     * @param player the player to run the repair for
     * @return the repair result
     */
Repairs the hot-bar including both hands.
@param player the player to run the repair for
@return the repair result
Repairs the hot - bar including both hands . @param player the player to run the repair for @return the repair result
public RepairResult repairHotBar(Player player) {
        PlayerInventory inventory = player.getInventory();
        byte repaired = 0;
        for (int slot : HOT_BAR.getContents())
            repaired += repairItem(inventory.getItem(slot)).getRepaired();
        repaired += repairHand(player, false).getRepaired();
        return new RepairResult(repaired > 0 ? RepairResult.Status.SUCCESS : RepairResult.Status.FAIL_GENERALIZED, repaired);
    }
public RepairResult repairHotBar ( Player player ) { PlayerInventory inventory = player . getInventory ( ) ; byte repaired = 0 ; for ( int slot : HOT_BAR . getContents ( ) ) repaired += repairItem ( inventory . getItem ( slot ) ) . getRepaired ( ) ; repaired += repairHand ( player , false ) . getRepaired ( ) ; return new RepairResult ( repaired > 0 ? RepairResult . Status . SUCCESS : RepairResult . Status . FAIL_GENERALIZED , repaired ) ; }
Repairs the hot-bar including both hands.
Repairs the hot - bar including both hands .
//The inventory //Amount of repaired items //Go through all items //Repair and count the repaired items //Repair the off-hand //Return