mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Add and wire up Herbalism AFK exploit toggle
This commit is contained in:
parent
b4e612b15b
commit
43600ef800
@ -87,4 +87,20 @@ public class ConfigExploitPrevention {
|
|||||||
public boolean isPreventAcrobaticsAbuse() {
|
public boolean isPreventAcrobaticsAbuse() {
|
||||||
return getConfigSectionExploitAcrobatics().isPreventAcrobaticsAbuse();
|
return getConfigSectionExploitAcrobatics().isPreventAcrobaticsAbuse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfigSectionExploitHerbalism getConfigSectionExploitHerbalism() {
|
||||||
|
return configSectionExploitSkills.getConfigSectionExploitHerbalism();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigSectionExploitMining getConfigSectionExploitMining() {
|
||||||
|
return configSectionExploitSkills.getConfigSectionExploitMining();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPreventCobblestoneStoneGeneratorXP() {
|
||||||
|
return configSectionExploitSkills.isPreventCobblestoneStoneGeneratorXP();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPreventVehicleAutoFarming() {
|
||||||
|
return configSectionExploitSkills.isPreventVehicleAutoFarming();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.gmail.nossr50.config.hocon.antiexploit;
|
||||||
|
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
|
@ConfigSerializable
|
||||||
|
public class ConfigSectionExploitHerbalism {
|
||||||
|
|
||||||
|
private static final boolean VEHICLE_XP_PREVENT_DEFAULT = true;
|
||||||
|
|
||||||
|
@Setting(value = "Prevent-Vehicle-Autofarming", comment = "This setting will prevent players from automating Herbalism XP via vehicles such as minecarts." +
|
||||||
|
"\nDefault value: "+VEHICLE_XP_PREVENT_DEFAULT)
|
||||||
|
private boolean preventVehicleAutoFarming = VEHICLE_XP_PREVENT_DEFAULT;
|
||||||
|
|
||||||
|
public boolean isPreventVehicleAutoFarming() {
|
||||||
|
return preventVehicleAutoFarming;
|
||||||
|
}
|
||||||
|
}
|
@ -14,6 +14,9 @@ public class ConfigSectionExploitSkills {
|
|||||||
@Setting(value = "Mining", comment = "Exploit settings related to Mining")
|
@Setting(value = "Mining", comment = "Exploit settings related to Mining")
|
||||||
private ConfigSectionExploitMining configSectionExploitMining = new ConfigSectionExploitMining();
|
private ConfigSectionExploitMining configSectionExploitMining = new ConfigSectionExploitMining();
|
||||||
|
|
||||||
|
@Setting(value = "Herbalism", comment = "Exploit settings related to Herbalism.")
|
||||||
|
private ConfigSectionExploitHerbalism configSectionExploitHerbalism = new ConfigSectionExploitHerbalism();
|
||||||
|
|
||||||
public ConfigSectionExploitAcrobatics getConfigSectionExploitAcrobatics() {
|
public ConfigSectionExploitAcrobatics getConfigSectionExploitAcrobatics() {
|
||||||
return configSectionExploitAcrobatics;
|
return configSectionExploitAcrobatics;
|
||||||
}
|
}
|
||||||
@ -22,6 +25,10 @@ public class ConfigSectionExploitSkills {
|
|||||||
return configSectionExploitFishing;
|
return configSectionExploitFishing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfigSectionExploitHerbalism getConfigSectionExploitHerbalism() {
|
||||||
|
return configSectionExploitHerbalism;
|
||||||
|
}
|
||||||
|
|
||||||
public ConfigSectionExploitMining getConfigSectionExploitMining() {
|
public ConfigSectionExploitMining getConfigSectionExploitMining() {
|
||||||
return configSectionExploitMining;
|
return configSectionExploitMining;
|
||||||
}
|
}
|
||||||
@ -30,6 +37,10 @@ public class ConfigSectionExploitSkills {
|
|||||||
return configSectionExploitMining.isPreventCobblestoneStoneGeneratorXP();
|
return configSectionExploitMining.isPreventCobblestoneStoneGeneratorXP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPreventVehicleAutoFarming() {
|
||||||
|
return configSectionExploitHerbalism.isPreventVehicleAutoFarming();
|
||||||
|
}
|
||||||
|
|
||||||
public long getFishingRodSpamMilliseconds() {
|
public long getFishingRodSpamMilliseconds() {
|
||||||
return configSectionExploitFishing.getFishingRodSpamMilliseconds();
|
return configSectionExploitFishing.getFishingRodSpamMilliseconds();
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,10 @@ import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel;
|
|||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.util.random.InvalidStaticChance;
|
import com.gmail.nossr50.util.random.InvalidStaticChance;
|
||||||
import com.google.common.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
import ninja.leaping.configurate.ValueType;
|
|
||||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||||
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
|
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hacky way to do this until I rewrite the skill system fully
|
* Hacky way to do this until I rewrite the skill system fully
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.gmail.nossr50.skills.herbalism;
|
package com.gmail.nossr50.skills.herbalism;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.MainConfig;
|
|
||||||
import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
|
import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
|
||||||
import com.gmail.nossr50.core.MetadataConstants;
|
import com.gmail.nossr50.core.MetadataConstants;
|
||||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||||
@ -37,7 +36,7 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canBlockCheck() {
|
public boolean canBlockCheck() {
|
||||||
return !(MainConfig.getInstance().getHerbalismPreventAFK() && getPlayer().isInsideVehicle());
|
return !(mcMMO.getConfigManager().getConfigExploitPrevention().isPreventVehicleAutoFarming() && getPlayer().isInsideVehicle());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canGreenThumbBlock(BlockState blockState) {
|
public boolean canGreenThumbBlock(BlockState blockState) {
|
||||||
|
Loading…
Reference in New Issue
Block a user