mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 16:59:37 +01:00
Use finals rather than local variables.
This commit is contained in:
parent
1ff1704697
commit
3194baffd7
@ -18,12 +18,14 @@ public class Archery {
|
||||
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
|
||||
|
||||
public static final int ARROW_TRACKING_MAX_BONUS_LEVEL = advancedConfig.getRetrieveMaxBonusLevel();
|
||||
public static final int ARROW_TRACKING_MAX_BONUS = advancedConfig.getRetrieveBonusMax();
|
||||
|
||||
public static final int BONUS_DAMAGE_INCREASE_LEVEL = advancedConfig.getSkillShotIncreaseLevel();
|
||||
public static final double BONUS_DAMAGE_INCREASE_PERCENT = advancedConfig.getSkillShotIncreasePercentage();
|
||||
public static final double BONUS_DAMAGE_MAX_BONUS_PERCENTAGE = advancedConfig.getSkillShotBonusMax();
|
||||
|
||||
public static final int DAZE_MAX_BONUS_LEVEL = advancedConfig.getDazeMaxBonusLevel();
|
||||
public static final int DAZE_MAX_BONUS = advancedConfig.getDazeBonusMax();
|
||||
public static final int DAZE_MODIFIER = advancedConfig.getDazeModifier();
|
||||
|
||||
protected static void incrementTrackerValue(LivingEntity livingEntity) {
|
||||
|
@ -4,25 +4,17 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
public class ArcheryManager {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
private Player player;
|
||||
private PlayerProfile profile;
|
||||
private int skillLevel;
|
||||
private Permissions permissionsInstance;
|
||||
|
||||
private float dazeBonusMax = advancedConfig.getDazeBonusMax();
|
||||
private float dazeMaxBonusLevel = advancedConfig.getDazeMaxBonusLevel();
|
||||
private float retrieveBonusMax = advancedConfig.getRetrieveBonusMax();
|
||||
private float retrieveMaxBonusLevel = advancedConfig.getRetrieveMaxBonusLevel();
|
||||
|
||||
public ArcheryManager (Player player) {
|
||||
this.player = player;
|
||||
this.profile = Users.getProfile(player);
|
||||
@ -57,7 +49,7 @@ public class ArcheryManager {
|
||||
if (player.hasPermission("mcmmo.perks.lucky.archery")) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
final float chance = (float) (((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * skillLevel);
|
||||
final float chance = (float) (((double) Archery.ARROW_TRACKING_MAX_BONUS / (double) Archery.ARROW_TRACKING_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Archery.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.addToTracker();
|
||||
}
|
||||
@ -88,7 +80,7 @@ public class ArcheryManager {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
final float chance = (float) (((double) dazeBonusMax / (double) dazeMaxBonusLevel) * skillLevel);
|
||||
final float chance = (float) (((double) Archery.DAZE_MAX_BONUS / (double) Archery.DAZE_MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (chance > Archery.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.handleDazeEffect();
|
||||
eventHandler.sendAbilityMessages();
|
||||
|
Loading…
x
Reference in New Issue
Block a user