mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-31 22:59:35 +01:00
Change xpHandler for new system usage
This commit marks the first breaking change for this new system
This commit is contained in:
parent
4eabd417b9
commit
9f9c0059a5
@ -153,23 +153,11 @@ public class Repair {
|
|||||||
* @param modify Amount to modify the durability by
|
* @param modify Amount to modify the durability by
|
||||||
* @param boost True if the modifier is a boost, false if the modifier is a reduction
|
* @param boost True if the modifier is a boost, false if the modifier is a reduction
|
||||||
*/
|
*/
|
||||||
private static void xpHandler(Player player, PlayerProfile PP, ItemStack is, short durabilityBefore, double modify) {
|
protected static void xpHandler(Player player, PlayerProfile PP, short durabilityBefore, short durabilityAfter, double modify) {
|
||||||
short durabilityAfter = is.getDurability();
|
|
||||||
short dif = (short) (durabilityBefore - durabilityAfter);
|
short dif = (short) (durabilityBefore - durabilityAfter);
|
||||||
|
|
||||||
dif = (short) (dif * modify);
|
dif = (short) (dif * modify);
|
||||||
|
|
||||||
//TODO: What exactly is this for, and should we have it for armor as well?
|
|
||||||
if (ItemChecks.isShovel(is)) {
|
|
||||||
dif = (short) (dif / 3);
|
|
||||||
}
|
|
||||||
else if(ItemChecks.isSword(is)) {
|
|
||||||
dif = (short) (dif / 2);
|
|
||||||
}
|
|
||||||
else if(ItemChecks.isHoe(is)) {
|
|
||||||
dif = (short) (dif / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
PP.addXP(player, SkillType.REPAIR, dif * 10);
|
PP.addXP(player, SkillType.REPAIR, dif * 10);
|
||||||
Skills.XpCheckSkill(SkillType.REPAIR, player);
|
Skills.XpCheckSkill(SkillType.REPAIR, player);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user