瀏覽代碼

Added option to disable gaining Acrobatics XP from dodging lightning
strikes. Fixes #481

GJ 12 年之前
父節點
當前提交
606195c78a

+ 3 - 0
src/main/java/com/gmail/nossr50/config/Config.java

@@ -268,6 +268,9 @@ public class Config extends ConfigLoader {
     public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
     public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
 
+    /* Dogde Lightning */
+    public boolean getDodgeLightningDisabled() {return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
+
     /* Level Caps */
     public int getLevelCapAcrobatics() {
         return getLevelCap("Skills.Acrobatics.Level_Cap");

+ 5 - 0
src/main/java/com/gmail/nossr50/util/Combat.java

@@ -8,6 +8,7 @@ import org.bukkit.entity.Arrow;
 import org.bukkit.entity.Entity;
 import org.bukkit.entity.EntityType;
 import org.bukkit.entity.IronGolem;
+import org.bukkit.entity.LightningStrike;
 import org.bukkit.entity.LivingEntity;
 import org.bukkit.entity.Player;
 import org.bukkit.entity.Skeleton;
@@ -221,6 +222,10 @@ public class Combat {
                 }
 
                 if (configInstance.getAcrobaticsPVE()) {
+                    if (damager instanceof LightningStrike && configInstance.getDodgeLightningDisabled()) {
+                        return;
+                    }
+
                     acroManager.dodgeCheck(event);
                 }
             }

+ 1 - 0
src/main/resources/config.yml

@@ -102,6 +102,7 @@ Skills:
         Enabled_For_PVP: true
         Enabled_For_PVE: true
         Prevent_AFK_Leveling: true
+        Prevent_Dodge_Lightning: false
         Level_Cap: 0 
     Archery:
         Enabled_For_PVP: true