2
0
Эх сурвалжийг харах

Add options for Fishing exploit prevention

nossr50 6 жил өмнө
parent
commit
efdd56684b

+ 1 - 0
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"

+ 6 - 0
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;
+    }
 }

+ 21 - 0
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;
+    }
+}