mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
We can move this check to exploitPrevention()
This commit is contained in:
parent
8aac6a992b
commit
49a5bd2ba6
@ -30,7 +30,7 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
public boolean canRoll() {
|
public boolean canRoll() {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
return (player.getItemInHand().getType() != Material.ENDER_PEARL) && !exploitPrevention() && Permissions.roll(player);
|
return !exploitPrevention() && Permissions.roll(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canDodge(Entity damager) {
|
public boolean canDodge(Entity damager) {
|
||||||
@ -126,15 +126,21 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean exploitPrevention() {
|
public boolean exploitPrevention() {
|
||||||
|
Player player = getPlayer();
|
||||||
|
|
||||||
|
if (player.getItemInHand().getType() == Material.ENDER_PEARL) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Config.getInstance().getAcrobaticsAFKDisabled()) {
|
if (!Config.getInstance().getAcrobaticsAFKDisabled()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPlayer().isInsideVehicle()) {
|
if (player.isInsideVehicle()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location fallLocation = getPlayer().getLocation();
|
Location fallLocation = player.getLocation();
|
||||||
|
|
||||||
boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2));
|
boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user