Browse Source

Added bypass permission for finding Fishing traps

TfT_02 11 years ago
parent
commit
1fea786669

+ 1 - 0
Changelog.txt

@@ -12,6 +12,7 @@ Version 1.4.08-dev
  + Added config options to disable various sound effects
  + Added config options to disable various sound effects
  + Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
  + Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
  + Added automatic cleanup of backups folder.
  + Added automatic cleanup of backups folder.
+ + Added bypass permission for finding Fishing traps
  = Fixed bug with toggle commands not properly displaying the success message.
  = Fixed bug with toggle commands not properly displaying the success message.
  = Fixed IllegalArgumentException caused by an empty Fishing treasure category
  = Fixed IllegalArgumentException caused by an empty Fishing treasure category
  = Fixed bug with Salvage not reading the config value for the anvil material.
  = Fixed bug with Salvage not reading the config value for the anvil material.

+ 4 - 0
src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java

@@ -489,6 +489,10 @@ public class FishingManager extends SkillManager {
     private void handleTraps() {
     private void handleTraps() {
         Player player = getPlayer();
         Player player = getPlayer();
 
 
+        if (Permissions.trapsBypass(player)) {
+            return;
+        }
+
         if (Misc.getRandom().nextBoolean()) {
         if (Misc.getRandom().nextBoolean()) {
             player.sendMessage(LocaleLoader.getString("Fishing.Ability.TH.Boom"));
             player.sendMessage(LocaleLoader.getString("Fishing.Ability.TH.Boom"));
 
 

+ 1 - 0
src/main/java/com/gmail/nossr50/util/Permissions.java

@@ -29,6 +29,7 @@ public final class Permissions {
     public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); }
     public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); }
     public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); }
     public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); }
     public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); }
     public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); }
+    public static boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingTraps"); }
 
 
     /* CHAT */
     /* CHAT */
     public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); }
     public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); }

+ 4 - 0
src/main/resources/plugin.yml

@@ -635,6 +635,7 @@ permissions:
             mcmmo.bypass.arcanebypass: true
             mcmmo.bypass.arcanebypass: true
             mcmmo.bypass.hardcoremode: true
             mcmmo.bypass.hardcoremode: true
             mcmmo.bypass.kraken: true
             mcmmo.bypass.kraken: true
+            mcmmo.bypass.fishingTraps: true
             mcmmo.commands.inspect.far: true
             mcmmo.commands.inspect.far: true
             mcmmo.commands.inspect.hidden: true
             mcmmo.commands.inspect.hidden: true
             mcmmo.commands.inspect.offline: true
             mcmmo.commands.inspect.offline: true
@@ -647,6 +648,9 @@ permissions:
     mcmmo.bypass.kraken:
     mcmmo.bypass.kraken:
         default: false
         default: false
         description: Allows user to bypass the effects of the exploit prevention when Fishing
         description: Allows user to bypass the effects of the exploit prevention when Fishing
+    mcmmo.bypass.fishingTraps:
+        default: false
+        description: Allows user to bypass finding traps when Fishing
     mcmmo.bypass.inspect.distance:
     mcmmo.bypass.inspect.distance:
         default: false
         default: false
         description: Allows user to bypass Inspect's distance requirements
         description: Allows user to bypass Inspect's distance requirements