浏览代码

fix Roll interactions with CMI fixes #5151

nossr50 4 月之前
父节点
当前提交
ef2aa57be3
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      Changelog.txt
  2. 2 1
      src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java

+ 1 - 0
Changelog.txt

@@ -1,4 +1,5 @@
 Version 2.2.032
 Version 2.2.032
+    Fixed bug where Roll would throw exceptions with certain CMI interactions
     Blast Mining no longer drops infested block variants
     Blast Mining no longer drops infested block variants
     Reduced bonus drops on Blast Mining and randomized results (see notes)
     Reduced bonus drops on Blast Mining and randomized results (see notes)
 
 

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

@@ -56,7 +56,8 @@ public class Roll extends AcrobaticsSubSkill {
         final EntityDamageEvent entityDamageEvent = (EntityDamageEvent) event;
         final EntityDamageEvent entityDamageEvent = (EntityDamageEvent) event;
 
 
         //Make sure a real player was damaged in this event
         //Make sure a real player was damaged in this event
-        if (!EventUtils.isRealPlayerDamaged(entityDamageEvent))
+        if (!EventUtils.isRealPlayerDamaged(entityDamageEvent)
+                || !entityDamageEvent.isApplicable(EntityDamageEvent.DamageModifier.MAGIC))
             return false;
             return false;
 
 
         if (entityDamageEvent.getCause() == EntityDamageEvent.DamageCause.FALL) {
         if (entityDamageEvent.getCause() == EntityDamageEvent.DamageCause.FALL) {