From efdd56684b176dcf57aa14839bb00b88f1e471de Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 14 Mar 2019 18:50:12 -0700 Subject: [PATCH] Add options for Fishing exploit prevention --- Changelog.txt | 1 + .../antiexploit/ConfigExploitPrevention.java | 6 ++++++ .../ConfigSectionExploitFishing.java | 21 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitFishing.java diff --git a/Changelog.txt b/Changelog.txt index b89fee751..e1aec067b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -32,6 +32,7 @@ Version 2.2.0 Added toggle for tamed mobs to give combat XP when struck Added toggle for acrobatics exploit prevention Added customizable limit for the number of locations acrobatics tracks for exploit prevention + Added toggle for fishing exploit prevention Settings related to Player Leveling are now found in "player_leveling.conf" Player Leveling's "TruncateSkills" renamed -> "Reduce-Player-Skills-Above-Cap" diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java index 6c066c15c..9cb105bd5 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java @@ -41,6 +41,8 @@ public class ConfigExploitPrevention { @Setting(value = "Acrobatics", comment = "Exploit settings related to Acrobatics") private ConfigSectionExploitAcrobatics configSectionExploitAcrobatics = new ConfigSectionExploitAcrobatics(); + @Setting(value = "Fishing", comment = "Exploit settings related to Fishing") + private ConfigSectionExploitFishing configSectionExploitFishing = new ConfigSectionExploitFishing(); public boolean getEndermenEndermiteFix() { return endermenEndermiteFix; @@ -61,4 +63,8 @@ public class ConfigExploitPrevention { public ConfigSectionExploitAcrobatics getConfigSectionExploitAcrobatics() { return configSectionExploitAcrobatics; } + + public ConfigSectionExploitFishing getConfigSectionExploitFishing() { + return configSectionExploitFishing; + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitFishing.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitFishing.java new file mode 100644 index 000000000..57ec8c8d0 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitFishing.java @@ -0,0 +1,21 @@ +package com.gmail.nossr50.config.hocon.antiexploit; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigSectionExploitFishing { + + private static final boolean PREVENT_FISHING_EXPLOITS_DEFAULT = true; + + @Setting(value = "Prevent-Fishing-AFK-Farming", + comment = "Prevents many methods for automatically farming Fishing XP." + + "\nSuch as farming in the same spot more than once." + + "\nSpam-click fishing." + + "\nDefault value: "+PREVENT_FISHING_EXPLOITS_DEFAULT) + private boolean preventFishingExploits = PREVENT_FISHING_EXPLOITS_DEFAULT; + + public boolean isPreventFishingExploits() { + return preventFishingExploits; + } +}