Add Acrobatics exploit prevention config settings

This commit is contained in:
nossr50
2019-03-14 18:33:05 -07:00
parent 04fdd3270a
commit 0d8b4c5f5f
5 changed files with 71 additions and 24 deletions

View File

@ -38,6 +38,9 @@ public class ConfigExploitPrevention {
"\nDefault value: "+TAMED_MOB_DEFAULT)
private boolean preventTamedMobXp = TAMED_MOB_DEFAULT;
@Setting(value = "Acrobatics", comment = "Exploit settings related to Acrobatics")
private ConfigSectionExploitAcrobatics configSectionExploitAcrobatics = new ConfigSectionExploitAcrobatics();
public boolean getEndermenEndermiteFix() {
return endermenEndermiteFix;
@ -54,4 +57,8 @@ public class ConfigExploitPrevention {
public boolean doTamedEntitiesGiveXP() {
return preventTamedMobXp;
}
public ConfigSectionExploitAcrobatics getConfigSectionExploitAcrobatics() {
return configSectionExploitAcrobatics;
}
}

View File

@ -0,0 +1,37 @@
package com.gmail.nossr50.config.hocon.antiexploit;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigSectionExploitAcrobatics {
public static final int ACROBATIC_LOCATION_LIMIT_DEFAULT = 50;
public static final boolean PREVENT_ACROBATICS_ABUSE_DEFAULT = true;
@Setting(value = "Player-Fall-Location-Tracking",
comment = "The amount of locations to keep track of for player falls." +
"\nThis setting does nothing if Prevent-Acrobatics-Farming is disabled" +
"\nEach player has their own individual list with up to 50 locations stored, locations are not shared between players." +
"\nPlayers cannot gain XP from falling in the same location twice." +
"\nIt's best you do not raise this number unless you have some kind of god computer," +
"\n mcMMO processes the entire tracked location list anytime a player takes fall damage so the bigger this is the more expensive that calculation is." +
"\nDefault value: "+ACROBATIC_LOCATION_LIMIT_DEFAULT)
private int acrobaticLocationLimit = ACROBATIC_LOCATION_LIMIT_DEFAULT;
@Setting(value = "Prevent-Acrobatics-Farming",
comment = "Prevents many common exploits for farming Acrobatics XP" +
"\nEnabled tracking player fall locations" +
"\nEnables tracking when a player last teleported" +
"\nEnables tracking when a player last respawned" +
"\nDefault value: "+PREVENT_ACROBATICS_ABUSE_DEFAULT)
private boolean preventAcrobaticsAbuse = PREVENT_ACROBATICS_ABUSE_DEFAULT;
public int getAcrobaticLocationLimit() {
return acrobaticLocationLimit;
}
public boolean isPreventAcrobaticsAbuse() {
return preventAcrobaticsAbuse;
}
}