mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-05 23:24:44 +02:00
Tweaked some stuff with adding XP, added an ExperienceAPI class.
This commit is contained in:
src/main/java/com/gmail/nossr50
@ -58,7 +58,7 @@ public class Acrobatics {
|
||||
|
||||
/* Check for death */
|
||||
if (health - damage >= 1) {
|
||||
PP.addXP(SkillType.ACROBATICS, damage * ROLL_XP_MODIFIER, player);
|
||||
PP.addXP(SkillType.ACROBATICS, damage * ROLL_XP_MODIFIER);
|
||||
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
|
||||
|
||||
event.setDamage(newDamage);
|
||||
@ -76,7 +76,7 @@ public class Acrobatics {
|
||||
}
|
||||
}
|
||||
else if (health - damage >= 1) {
|
||||
PP.addXP(SkillType.ACROBATICS, event.getDamage() * FALL_XP_MODIFIER, player);
|
||||
PP.addXP(SkillType.ACROBATICS, event.getDamage() * FALL_XP_MODIFIER);
|
||||
Skills.XpCheckSkill(SkillType.ACROBATICS, player);
|
||||
}
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class Acrobatics {
|
||||
defender.sendMessage(mcLocale.getString("Acrobatics.Dodge"));
|
||||
|
||||
if (System.currentTimeMillis() >= (5000 + PPd.getRespawnATS()) && defender.getHealth() >= 1) {
|
||||
PPd.addXP(SkillType.ACROBATICS, damage * DODGE_MODIFIER, defender);
|
||||
PPd.addXP(SkillType.ACROBATICS, damage * DODGE_MODIFIER);
|
||||
Skills.XpCheckSkill(SkillType.ACROBATICS, defender);
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ public class BlastMining {
|
||||
Block block = player.getTargetBlock(transparent, BLOCKS_AWAY);
|
||||
|
||||
if (block.getType().equals(Material.TNT) && m.blockBreakSimulate(block, player, true) && PP.getSkillLevel(SkillType.MINING) >= 125) {
|
||||
final int MAX_DISTANCE_AWAY = 10;
|
||||
final double MAX_DISTANCE_AWAY = 10.0;
|
||||
AbilityType ability = AbilityType.BLAST_MINING;
|
||||
|
||||
/* Check Cooldown */
|
||||
|
@ -120,7 +120,7 @@ public class Excavation {
|
||||
}
|
||||
|
||||
//Handle XP related tasks
|
||||
PP.addXP(SkillType.EXCAVATION, xp, player);
|
||||
PP.addXP(SkillType.EXCAVATION, xp);
|
||||
Skills.XpCheckSkill(SkillType.EXCAVATION, player);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class Fishing {
|
||||
FishingTreasure treasure = rewards.get(random.nextInt(rewards.size()));
|
||||
|
||||
if (random.nextInt(100) <= treasure.getDropChance()) {
|
||||
Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp(), player);
|
||||
Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp());
|
||||
theCatch.setItemStack(treasure.getDrop());
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class Fishing {
|
||||
}
|
||||
|
||||
m.mcDropItem(player.getLocation(), new ItemStack(Material.RAW_FISH)); //Always drop a fish
|
||||
PP.addXP(SkillType.FISHING, LoadProperties.mfishing, player);
|
||||
PP.addXP(SkillType.FISHING, LoadProperties.mfishing);
|
||||
Skills.XpCheckSkill(SkillType.FISHING, player);
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ public class Herbalism {
|
||||
}
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.HERBALISM, xp, player);
|
||||
PP.addXP(SkillType.HERBALISM, xp);
|
||||
Skills.XpCheckSkill(SkillType.HERBALISM, player);
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class Mining {
|
||||
break;
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.MINING, xp, player);
|
||||
PP.addXP(SkillType.MINING, xp);
|
||||
Skills.XpCheckSkill(SkillType.MINING, player);
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class Repair {
|
||||
dif = (short) (dif / 2);
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.REPAIR, dif * 10, player);
|
||||
PP.addXP(SkillType.REPAIR, dif * 10);
|
||||
Skills.XpCheckSkill(SkillType.REPAIR, player);
|
||||
|
||||
//CLANG CLANG
|
||||
|
@ -26,7 +26,7 @@ import com.gmail.nossr50.locale.mcLocale;
|
||||
public class Skills {
|
||||
|
||||
private final static int TIME_CONVERSION_FACTOR = 1000;
|
||||
private final static int MAX_DISTANCE_AWAY = 10;
|
||||
private final static double MAX_DISTANCE_AWAY = 10.0;
|
||||
|
||||
/**
|
||||
* Checks to see if the cooldown for an item or ability is expired.
|
||||
|
@ -156,7 +156,7 @@ public class WoodCutting {
|
||||
}
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player); //Tree Feller gives nerf'd XP
|
||||
PP.addXP(SkillType.WOODCUTTING, xp); //Tree Feller gives nerf'd XP
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ public class WoodCutting {
|
||||
}
|
||||
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
PP.addXP(SkillType.WOODCUTTING, xp);
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user