소스 검색

mcMMO will ignore damage triggers for events with a value of zero

nossr50 6 년 전
부모
커밋
9ab4d59cca
3개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      Changelog.txt
  2. 1 1
      pom.xml
  3. 13 0
      src/main/java/com/gmail/nossr50/listeners/EntityListener.java

+ 4 - 0
Changelog.txt

@@ -1,3 +1,7 @@
+Version 2.1.88
+    mcMMO is now more compatible with a plugin named Project Korra
+    mcMMO will no longer process combat triggers for damage at or below 0
+
 Version 2.1.87
 Version 2.1.87
     (Level caps are not on by default in mcMMO, this is something you can turn on)
     (Level caps are not on by default in mcMMO, this is something you can turn on)
 
 

+ 1 - 1
pom.xml

@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <groupId>com.gmail.nossr50.mcMMO</groupId>
     <artifactId>mcMMO</artifactId>
     <artifactId>mcMMO</artifactId>
-    <version>2.1.87</version>
+    <version>2.1.88</version>
     <name>mcMMO</name>
     <name>mcMMO</name>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <url>https://github.com/mcMMO-Dev/mcMMO</url>
     <scm>
     <scm>

+ 13 - 0
src/main/java/com/gmail/nossr50/listeners/EntityListener.java

@@ -416,6 +416,19 @@ public class EntityListener implements Listener {
             }
             }
         }
         }
 
 
+        /*
+         * This was put here to solve a plugin conflict with a mod called Project Korra
+         * Project Korra sends out a damage event with exactly 0 damage
+         * mcMMO does some calculations for the damage in an event and it ends up dividing by zero,
+         *  as a result of the modifiers for the event being 0 and the damage set for this event being 0.
+         *
+         * Surprising this kind of thing
+         *
+         */
+        if(damage <= 0) {
+            return;
+        }
+
         CombatUtils.processCombatAttack(event, attacker, target);
         CombatUtils.processCombatAttack(event, attacker, target);
         CombatUtils.handleHealthbars(attacker, target, event.getFinalDamage(), plugin);
         CombatUtils.handleHealthbars(attacker, target, event.getFinalDamage(), plugin);