Skip to content

Commit

Permalink
Damage & Heal displays - blacklist ArmorStand
Browse files Browse the repository at this point in the history
  • Loading branch information
d0by1 committed Dec 19, 2022
1 parent 032ee49 commit 420682b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.NonNull;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void onDamage(EntityDamageEvent e) {

Entity entity = e.getEntity();

if (!(entity instanceof LivingEntity)) {
if (!(entity instanceof LivingEntity) || entity instanceof ArmorStand) {
return;
}

Expand Down Expand Up @@ -137,7 +138,7 @@ private boolean isCritical(@NonNull Player player) {
}
try {
// Slow Falling is not in all versions
if (player.hasPotionEffect(PotionEffectType.SLOW_FALLING)) {
if (player.hasPotionEffect(PotionEffectType.getByName("SLOW_FALLING"))) {
return false;
}
} catch (Exception ignored) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import eu.decentsoftware.holograms.api.utils.config.FileConfig;
import eu.decentsoftware.holograms.api.utils.location.LocationUtils;
import org.bukkit.Location;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -86,7 +87,7 @@ public void onRegain(EntityRegainHealthEvent e) {

Entity entity = e.getEntity();

if (!(entity instanceof LivingEntity)) {
if (!(entity instanceof LivingEntity) || entity instanceof ArmorStand) {
return;
}

Expand Down

0 comments on commit 420682b

Please sign in to comment.