mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Refactor to getMaxLength
This commit is contained in:
parent
ec6419f0ff
commit
17faf1561f
@ -143,7 +143,7 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String[] calculateLengthDisplayValues() {
|
protected String[] calculateLengthDisplayValues() {
|
||||||
int maxLength = skill.getAbility().getMaxTicks();
|
int maxLength = skill.getAbility().getMaxLength();
|
||||||
int length = 2 + (int) (skillValue / AdvancedConfig.getInstance().getAbilityLength());
|
int length = 2 + (int) (skillValue / AdvancedConfig.getInstance().getAbilityLength());
|
||||||
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
|
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
|
public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
|
||||||
|
|
||||||
public int getCooldown(AbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
|
public int getCooldown(AbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
|
||||||
public int getMaxTicks(AbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
|
public int getMaxLength(AbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
|
||||||
|
|
||||||
/* Durability Settings */
|
/* Durability Settings */
|
||||||
public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); }
|
public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); }
|
||||||
|
@ -99,8 +99,8 @@ public enum AbilityType {
|
|||||||
return Config.getInstance().getCooldown(this);
|
return Config.getInstance().getCooldown(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxTicks() {
|
public int getMaxLength() {
|
||||||
return Config.getInstance().getMaxTicks(this);
|
return Config.getInstance().getMaxLength(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityOn() {
|
public String getAbilityOn() {
|
||||||
|
@ -283,7 +283,7 @@ public class SkillUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ticks = PerksUtils.handleActivationPerks(player, 2 + (playerProfile.getSkillLevel(type) / AdvancedConfig.getInstance().getAbilityLength()), ability.getMaxTicks());
|
int ticks = PerksUtils.handleActivationPerks(player, 2 + (playerProfile.getSkillLevel(type) / AdvancedConfig.getInstance().getAbilityLength()), ability.getMaxLength());
|
||||||
|
|
||||||
ParticleEffectUtils.playAbilityEnabledEffect(player);
|
ParticleEffectUtils.playAbilityEnabledEffect(player);
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ public class SkillUtils {
|
|||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
SkillType skill = mcMMOPlayer.getAbilityMode(AbilityType.SUPER_BREAKER) ? SkillType.MINING : SkillType.EXCAVATION;
|
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()) * Misc.TICK_CONVERSION_FACTOR;
|
int ticks = PerksUtils.handleActivationPerks(player, 2 + (mcMMOPlayer.getProfile().getSkillLevel(skill) / AdvancedConfig.getInstance().getAbilityLength()), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR;
|
||||||
|
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user