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

This commit is contained in:
nossr50 2019-07-07 02:07:55 -07:00
parent 67a687ee40
commit c818bf82b0
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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()));