mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Fix exploitPrevention() and add Javadocs
This commit is contained in:
parent
c612036db3
commit
be792a1052
@ -429,9 +429,9 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
|
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
|
||||||
|
|
||||||
/* AFK Leveling */
|
/* AFK Leveling */
|
||||||
public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
|
public boolean getAcrobaticsPreventAFK() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
|
||||||
public int getAcrobaticsAFKMaxTries() { return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); }
|
public int getAcrobaticsAFKMaxTries() { return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); }
|
||||||
public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
|
public boolean getHerbalismPreventAFK() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
|
||||||
|
|
||||||
/* Level Caps */
|
/* Level Caps */
|
||||||
public int getPowerLevelCap() {
|
public int getPowerLevelCap() {
|
||||||
|
@ -123,10 +123,20 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player is "farming" Acrobatics XP using
|
||||||
|
* exploits in the game.
|
||||||
|
*
|
||||||
|
* @return true if exploits are detected, false otherwise
|
||||||
|
*/
|
||||||
public boolean exploitPrevention() {
|
public boolean exploitPrevention() {
|
||||||
|
if (!Config.getInstance().getAcrobaticsPreventAFK()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (player.getItemInHand().getType() == Material.ENDER_PEARL || Config.getInstance().getAcrobaticsAFKDisabled() || player.isInsideVehicle()) {
|
if (player.getItemInHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canBlockCheck() {
|
public boolean canBlockCheck() {
|
||||||
return !(Config.getInstance().getHerbalismAFKDisabled() && getPlayer().isInsideVehicle());
|
return !(Config.getInstance().getHerbalismPreventAFK() && getPlayer().isInsideVehicle());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canGreenThumbBlock(BlockState blockState) {
|
public boolean canGreenThumbBlock(BlockState blockState) {
|
||||||
|
Loading…
Reference in New Issue
Block a user