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

Added option to advanced.yml to determine the # of enchant levels used
when buffing Super Breaker & Giga Drill Breaker

GJ 12 жил өмнө
parent
commit
3219674678

+ 1 - 0
Changelog.txt

@@ -8,6 +8,7 @@ Key:
   - Removal
 
 Version 1.4.03-dev
+ + Added option to advanced.yml to determine the # of enchant levels used when buffing Super Breaker & Giga Drill Breaker
  = Fixed bug where players were unable to salvage leather armor
  = Fixed bug with repairing using materials with byte metadata
  = Fixed bug where Fishing was becoming less successful at higher levels

+ 1 - 0
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -20,6 +20,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
 
     /* GENERAL */
     public int getAbilityLength() { return config.getInt("Skills.General.Ability_IncreaseLevel", 50); }
+    public int getEnchantBuff() { return config.getInt("Skills.General.Ability_EnchantBuff", 5); }
 
     /* ACROBATICS */
     public double getDodgeChanceMax() { return config.getDouble("Skills.Acrobatics.Dodge_ChanceMax", 20.0D); }

+ 5 - 3
src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java

@@ -40,6 +40,8 @@ import com.gmail.nossr50.util.player.UserManager;
 import com.gmail.nossr50.util.spout.SpoutUtils;
 
 public class SkillUtils {
+    private static int enchantBuff = AdvancedConfig.getInstance().getEnchantBuff();
+
     public static int handleFoodSkills(Player player, SkillType skill, int eventFoodLevel, int baseLevel, int maxLevel, int rankChange) {
         int skillLevel = UserManager.getPlayer(player).getProfile().getSkillLevel(skill);
 
@@ -477,7 +479,7 @@ public class SkillUtils {
             }
 
             itemLore.add("mcMMO Ability Tool");
-            itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + 5, true);
+            itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + enchantBuff, true);
 
             itemMeta.setLore(itemLore);
             heldItem.setItemMeta(itemMeta);
@@ -543,11 +545,11 @@ public class SkillUtils {
                 if (itemLore.remove("mcMMO Ability Tool")) {
                     int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
 
-                    if (efficiencyLevel <= 5) {
+                    if (efficiencyLevel <= enchantBuff) {
                         itemMeta.removeEnchant(Enchantment.DIG_SPEED);
                     }
                     else {
-                        itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - 5, true);
+                        itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - enchantBuff, true);
                     }
 
                     itemMeta.setLore(itemLore);

+ 2 - 0
src/main/resources/advanced.yml

@@ -16,6 +16,8 @@ Skills:
     General:
         # This setting will determine when the length of every ability gets longer with 1 second
         Ability_IncreaseLevel: 50
+        # This setting determines how many enchant levels to use when buffing Super Breaker & Giga Drill Breaker
+        Ability_EnchantBuff: 5
     #
     #  Settings for Acrobatics
     ###