mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
@@ -39,7 +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, EntityDamageEvent.DamageCause.KILL);
|
private final List<String> ignoredDamageCauses = Arrays.asList("SUICIDE", "VOID", "CUSTOM", "KILL");
|
||||||
|
|
||||||
public EntityDamage(ToolStats toolStats) {
|
public EntityDamage(ToolStats toolStats) {
|
||||||
this.toolStats = toolStats;
|
this.toolStats = toolStats;
|
||||||
@@ -57,8 +57,8 @@ public class EntityDamage implements Listener {
|
|||||||
LivingEntity mobBeingAttacked = (LivingEntity) event.getEntity();
|
LivingEntity mobBeingAttacked = (LivingEntity) event.getEntity();
|
||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
String cause = event.getCause().toString().toUpperCase();
|
||||||
if (ignoredCauses.contains(cause)) {
|
if (ignoredDamageCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,8 +166,8 @@ public class EntityDamage implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
String cause = event.getCause().toString().toUpperCase();
|
||||||
if (ignoredCauses.contains(cause)) {
|
if (ignoredDamageCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,8 +196,8 @@ public class EntityDamage implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore void and /kill damage
|
// ignore void and /kill damage
|
||||||
EntityDamageEvent.DamageCause cause = event.getCause();
|
String cause = event.getCause().toString().toUpperCase();
|
||||||
if (ignoredCauses.contains(cause)) {
|
if (ignoredDamageCauses.contains(cause)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,15 +64,14 @@ public class SheepShear implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sheep sheep = (Sheep) entity;
|
|
||||||
// make sure the sheep is not sheared
|
// make sure the sheep is not sheared
|
||||||
|
Sheep sheep = (Sheep) entity;
|
||||||
if (sheep.isSheared()) {
|
if (sheep.isSheared()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the stats
|
// update the stats
|
||||||
ItemStack finalShears = shears;
|
addLore(shears);
|
||||||
addLore(finalShears);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static @Nullable ItemStack getShears(Player player) {
|
private static @Nullable ItemStack getShears(Player player) {
|
||||||
|
|||||||
Reference in New Issue
Block a user