mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Acrobatics: cap same-location fall counter for XP gain
It used to increase boundlessly, thus preventing players from gaining XP for a while even after moving to another place.
This commit is contained in:
parent
ec1a125809
commit
958c116fd0
@ -142,13 +142,14 @@ public class AcrobaticsManager extends SkillManager {
|
||||
}
|
||||
|
||||
Location fallLocation = player.getLocation();
|
||||
int maxTries = Config.getInstance().getAcrobaticsAFKMaxTries();
|
||||
|
||||
boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2));
|
||||
|
||||
fallTries = sameLocation ? fallTries + 1 : Math.max(fallTries - 1, 0);
|
||||
fallTries = sameLocation ? Math.min(fallTries + 1, maxTries) : Math.max(fallTries - 1, 0);
|
||||
lastFallLocation = fallLocation;
|
||||
|
||||
return fallTries > Config.getInstance().getAcrobaticsAFKMaxTries();
|
||||
return fallTries >= maxTries;
|
||||
}
|
||||
|
||||
private boolean isFatal(double damage) {
|
||||
|
Loading…
Reference in New Issue
Block a user