浏览代码

Fixed a bug where Roll didn't award XP at great heights

nossr50 4 年之前
父节点
当前提交
56abad5360

+ 3 - 1
Changelog.txt

@@ -1,4 +1,6 @@
 Version 2.1.144
+    Fixed a bug where Roll wouldn't award XP when fall height was over a certain amount
+    Lowered the XP ceiling of Roll
     Fixed a NPE that would happen involving taming in combat processing
     Updated hu_HU locale (thanks andris155)
     mmodebug mode now prints some information when fuel efficiency is applied to a furnace
@@ -9,7 +11,7 @@ Version 2.1.143
     mcMMO now tracks super ability boosted items through persistent metadata
     mcMMO no longer relies on lore to tell if an item has been modified by a super ability
     Slight buff to Rupture (1 more tick duration across all ranks)
-    Lore no longer gets added to items being buffed by mcMMO
+    Lore no longer gets added to items being buffed by mcMMO./
 
     NOTES:
         The item tracking is persistent for MC versions 1.13-1.16.2 (and beyond). However the code handling the persistence for 1.13.2 differs from the other versions. It shouldn't result in any problems.

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

@@ -76,7 +76,7 @@ public class Roll extends AcrobaticsSubSkill {
              */
             Player player = (Player) ((EntityDamageEvent) event).getEntity();
             if (canRoll(player)) {
-                entityDamageEvent.setDamage(rollCheck(player, mcMMOPlayer, entityDamageEvent.getDamage()));
+                entityDamageEvent.setDamage(rollCheck(player, mcMMOPlayer, entityDamageEvent.getFinalDamage()));
 
                 if (entityDamageEvent.getFinalDamage() == 0) {
                     entityDamageEvent.setCancelled(true);
@@ -293,7 +293,7 @@ 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);
+        damage = Math.min(20, damage);
 
         ItemStack boots = player.getInventory().getBoots();
         float xp = (float) (damage * (isRoll ? ExperienceConfig.getInstance().getRollXPModifier() : ExperienceConfig.getInstance().getFallXPModifier()));

+ 1 - 1
src/main/java/com/gmail/nossr50/util/compat/CompatibilityManager.java

@@ -5,8 +5,8 @@ import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.util.StringUtils;
 import com.gmail.nossr50.util.compat.layers.attackcooldown.PlayerAttackCooldownExploitPreventionLayer;
 import com.gmail.nossr50.util.compat.layers.persistentdata.AbstractPersistentDataLayer;
-import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_14;
 import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_13;
+import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_14;
 import com.gmail.nossr50.util.nms.NMSVersion;
 import com.gmail.nossr50.util.platform.MinecraftGameVersion;
 import org.bukkit.command.CommandSender;