@@ -39,6 +39,7 @@ public class EntityDamage implements Listener {
3939
4040 private final ToolStats toolStats ;
4141 public final Set <UUID > trackedMobs = new HashSet <>();
42+ private final List <EntityDamageEvent .DamageCause > ignoredCauses = Arrays .asList (EntityDamageEvent .DamageCause .SUICIDE , EntityDamageEvent .DamageCause .VOID , EntityDamageEvent .DamageCause .CUSTOM );
4243
4344 public EntityDamage (ToolStats toolStats ) {
4445 this .toolStats = toolStats ;
@@ -57,7 +58,7 @@ public void onDamage(EntityDamageByEntityEvent event) {
5758
5859 // ignore void and /kill damage
5960 EntityDamageEvent .DamageCause cause = event .getCause ();
60- if (cause == EntityDamageEvent . DamageCause . SUICIDE || cause == EntityDamageEvent . DamageCause . VOID ) {
61+ if (ignoredCauses . contains ( cause ) ) {
6162 return ;
6263 }
6364
@@ -152,7 +153,7 @@ public void onDamage(EntityDamageEvent event) {
152153
153154 // ignore void and /kill damage
154155 EntityDamageEvent .DamageCause cause = event .getCause ();
155- if (cause == EntityDamageEvent . DamageCause . SUICIDE || cause == EntityDamageEvent . DamageCause . VOID ) {
156+ if (ignoredCauses . contains ( cause ) ) {
156157 return ;
157158 }
158159
@@ -182,7 +183,7 @@ public void onDamage(EntityDamageByBlockEvent event) {
182183
183184 // ignore void and /kill damage
184185 EntityDamageEvent .DamageCause cause = event .getCause ();
185- if (cause == EntityDamageEvent . DamageCause . SUICIDE || cause == EntityDamageEvent . DamageCause . VOID ) {
186+ if (ignoredCauses . contains ( cause ) ) {
186187 return ;
187188 }
188189
0 commit comments