mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-07 21:25:00 +00:00
ignore CUSTOM damage causes
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<groupId>lol.hyper</groupId>
|
<groupId>lol.hyper</groupId>
|
||||||
<artifactId>toolstats</artifactId>
|
<artifactId>toolstats</artifactId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ToolStats</name>
|
<name>ToolStats</name>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
private final ToolStats toolStats;
|
private final ToolStats toolStats;
|
||||||
public final Set<UUID> trackedMobs = new HashSet<>();
|
public final Set<UUID> trackedMobs = new HashSet<>();
|
||||||
|
private final List<EntityDamageEvent.DamageCause> ignoredCauses = Arrays.asList(EntityDamageEvent.DamageCause.SUICIDE, EntityDamageEvent.DamageCause.VOID, EntityDamageEvent.DamageCause.CUSTOM);
|
||||||
|
|
||||||
public EntityDamage(ToolStats toolStats) {
|
public EntityDamage(ToolStats toolStats) {
|
||||||
this.toolStats = toolStats;
|
this.toolStats = toolStats;
|
||||||
@@ -57,7 +58,7 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
EntityDamageEvent.DamageCause cause = event.getCause();
|
||||||
if (cause == EntityDamageEvent.DamageCause.SUICIDE || cause == EntityDamageEvent.DamageCause.VOID) {
|
if (ignoredCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +153,7 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
EntityDamageEvent.DamageCause cause = event.getCause();
|
||||||
if (cause == EntityDamageEvent.DamageCause.SUICIDE || cause == EntityDamageEvent.DamageCause.VOID) {
|
if (ignoredCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +183,7 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
EntityDamageEvent.DamageCause cause = event.getCause();
|
||||||
if (cause == EntityDamageEvent.DamageCause.SUICIDE || cause == EntityDamageEvent.DamageCause.VOID) {
|
if (ignoredCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user