mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Clean up some stuff with our DATS.
This commit is contained in:
parent
f2b2cd9cc0
commit
965dbda101
@ -284,10 +284,7 @@ public class MiningManager extends SkillManager {
|
|||||||
private boolean blastMiningCooldownOver() {
|
private boolean blastMiningCooldownOver() {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
PlayerProfile profile = getProfile();
|
PlayerProfile profile = getProfile();
|
||||||
|
int timeRemaining = SkillUtils.calculateTimeLeft(profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR, AbilityType.BLAST_MINING.getCooldown(), player);
|
||||||
long oldTime = profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR;
|
|
||||||
int cooldown = AbilityType.BLAST_MINING.getCooldown();
|
|
||||||
int timeRemaining = SkillUtils.calculateTimeLeft(oldTime, cooldown, player);
|
|
||||||
|
|
||||||
if (timeRemaining > 0) {
|
if (timeRemaining > 0) {
|
||||||
player.sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));
|
player.sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));
|
||||||
|
@ -392,14 +392,8 @@ public class SkillUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
int ticks = 0;
|
SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) ? SkillType.MINING : SkillType.EXCAVATION;
|
||||||
|
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getProfile().getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxTicks()) * 20;
|
||||||
if (mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
|
||||||
ticks = ((int) (mcMMOPlayer.getProfile().getSkillDATS(AbilityType.SUPER_BREAKER) - (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR))) * 20;
|
|
||||||
}
|
|
||||||
else if (mcMMOPlayer.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
|
|
||||||
ticks = ((int) (mcMMOPlayer.getProfile().getSkillDATS(AbilityType.GIGA_DRILL_BREAKER) - (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR))) * 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
|
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.FAST_DIGGING, duration + ticks, amplifier + 10);
|
||||||
player.addPotionEffect(abilityBuff, true);
|
player.addPotionEffect(abilityBuff, true);
|
||||||
@ -415,9 +409,6 @@ public class SkillUtils {
|
|||||||
playerInventory.setItem(i, removeAbilityBuff(item));
|
playerInventory.setItem(i, removeAbilityBuff(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
player.removePotionEffect(PotionEffectType.FAST_DIGGING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack removeAbilityBuff(ItemStack item) {
|
public static ItemStack removeAbilityBuff(ItemStack item) {
|
||||||
|
Loading…
Reference in New Issue
Block a user