mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
@ -155,7 +155,7 @@ public class RepairManager extends SkillManager {
|
||||
Repair.removeOneFrom(inventory, repairItemLocation);
|
||||
|
||||
// Give out XP like candy
|
||||
applyXpGain((int) ((startDurability - newDurability) * repairable.getXpMultiplier()) * 10);
|
||||
applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * Config.getInstance().getRepairXPBase() * Config.getInstance().getRepairXP(repairable.getRepairMaterialType())));
|
||||
|
||||
// BWONG BWONG BWONG
|
||||
player.playSound(player.getLocation(), Sound.ANVIL_USE, Misc.ANVIL_USE_VOLUME, Misc.ANVIL_USE_PITCH);
|
||||
@ -164,6 +164,10 @@ public class RepairManager extends SkillManager {
|
||||
item.setDurability(newDurability);
|
||||
}
|
||||
|
||||
private float getPercentageRepaired(short startDurability, short newDurability, short totalDurability) {
|
||||
return ((startDurability - newDurability) / (float) totalDurability);
|
||||
}
|
||||
|
||||
public void handleSalvage(Location location, ItemStack item) {
|
||||
Player player = getPlayer();
|
||||
|
||||
|
@ -53,7 +53,7 @@ public interface Repairable {
|
||||
public short getMaximumDurability();
|
||||
|
||||
/**
|
||||
* Gets the base repair durability on which to calcuate bonuses.
|
||||
* Gets the base repair durability on which to calculate bonuses.
|
||||
*
|
||||
* This is actually the maximum durability divided by the minimum quantity
|
||||
*
|
||||
|
Reference in New Issue
Block a user