Browse Source

Cap how much XP can be given for Roll based on damage

nossr50 6 năm trước cách đây
mục cha
commit
c818bf82b0

+ 1 - 0
Changelog.txt

@@ -5,6 +5,7 @@ Version 2.1.95
     Fixed a bug which could cause Large Fern's to reward less XP
     Fixed a bug where certain herbalism crops could have fewer than intended bonus drops
     Fixed a bug involving Ender Pearl and Acrobatics
+    Added some protection to Acrobatics to prevent gaining too much XP in one Roll.
     Added 'Carrots, Cocoa, Potatoes, Wheat, Beetroots, Nether_Wart' to Herbalism in experience.yml (See notes)
     Removed the _Ripe entries from experience.yml (no longer used)
     Added missing 'Chorus_Flower' entry to herbalism in experience.yml

+ 3 - 0
src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java

@@ -297,6 +297,9 @@ public class Roll extends AcrobaticsSubSkill {
     }
 
     private float calculateRollXP(Player player, double damage, boolean isRoll) {
+        //Clamp Damage to account for insane DRs
+        damage = Math.min(40, damage);
+
         ItemStack boots = player.getInventory().getBoots();
         float xp = (float) (damage * (isRoll ? ExperienceConfig.getInstance().getRollXPModifier() : ExperienceConfig.getInstance().getFallXPModifier()));