@@ -39,7 +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 , EntityDamageEvent . DamageCause . KILL );
42+ private final List <String > ignoredDamageCauses = Arrays .asList (" SUICIDE" , " VOID" , " CUSTOM" , " KILL" );
4343
4444 public EntityDamage (ToolStats toolStats ) {
4545 this .toolStats = toolStats ;
@@ -57,8 +57,8 @@ public void onDamage(EntityDamageByEntityEvent event) {
5757 LivingEntity mobBeingAttacked = (LivingEntity ) event .getEntity ();
5858
5959 // ignore void and /kill damage
60- EntityDamageEvent . DamageCause cause = event .getCause ();
61- if (ignoredCauses .contains (cause )) {
60+ String cause = event .getCause (). toString (). toUpperCase ();
61+ if (ignoredDamageCauses .contains (cause )) {
6262 return ;
6363 }
6464
@@ -166,8 +166,8 @@ public void onDamage(EntityDamageEvent event) {
166166 }
167167
168168 // ignore void and /kill damage
169- EntityDamageEvent . DamageCause cause = event .getCause ();
170- if (ignoredCauses .contains (cause )) {
169+ String cause = event .getCause (). toString (). toUpperCase ();
170+ if (ignoredDamageCauses .contains (cause )) {
171171 return ;
172172 }
173173
@@ -196,8 +196,8 @@ public void onDamage(EntityDamageByBlockEvent event) {
196196 }
197197
198198 // ignore void and /kill damage
199- EntityDamageEvent . DamageCause cause = event .getCause ();
200- if (ignoredCauses .contains (cause )) {
199+ String cause = event .getCause (). toString (). toUpperCase ();
200+ if (ignoredDamageCauses .contains (cause )) {
201201 return ;
202202 }
203203
0 commit comments