mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Changed bonus to float
Fixes bug where only 1 diamond was needed to fully repair an almost broken diamond pickaxe
This commit is contained in:
parent
bb1dbab984
commit
cdb5fed5a5
@ -14,8 +14,6 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.gmail.nossr50.commands.general.AddlevelsCommand;
|
||||
import com.gmail.nossr50.commands.general.AddxpCommand;
|
||||
import com.gmail.nossr50.commands.general.InspectCommand;
|
||||
|
@ -210,12 +210,12 @@ public class Repair {
|
||||
* @return The final amount of durability repaired to the item
|
||||
*/
|
||||
protected static short repairCalculate(Player player, int skillLevel, short durability, int repairAmount) {
|
||||
double bonus;
|
||||
if(skillLevel >= repairMasteryMaxBonusLevel) bonus = (double) repairMasteryChanceMax;
|
||||
else bonus = ((double) skillLevel / (double) repairMasteryMaxBonusLevel) * (double) repairMasteryChanceMax;
|
||||
float bonus;
|
||||
if(skillLevel >= repairMasteryMaxBonusLevel) bonus = repairMasteryChanceMax;
|
||||
else bonus = (skillLevel / repairMasteryMaxBonusLevel) * repairMasteryChanceMax;
|
||||
|
||||
if (permInstance.repairMastery(player)) {
|
||||
bonus = ((double) repairAmount * bonus);
|
||||
bonus = (repairAmount * bonus);
|
||||
repairAmount += (int) bonus;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user