From 9706c830e4d5c781e8271bf1b850ff69349b5a89 Mon Sep 17 00:00:00 2001 From: Logan Magnan Date: Sun, 22 Sep 2024 10:17:21 -0400 Subject: [PATCH] fixed --- pom.xml | 2 +- .../invisibleplayers/runnables/EntityRunnable.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b873ff4..e8534a8 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ org.projectlombok lombok - 1.18.20 + 1.18.30 provided diff --git a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java index 6a43bc7..37825a1 100644 --- a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java +++ b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java @@ -4,6 +4,7 @@ import com.loganmagnan.invisibleplayers.InvisiblePlayers; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffectType; import java.util.List; @@ -14,6 +15,10 @@ public class EntityRunnable { public EntityRunnable() { this.main.getServer().getScheduler().runTaskTimerAsynchronously(this.main, () -> { for (Player player : this.main.getServer().getOnlinePlayers()) { + if (!player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { + continue; + } + List nearbyEntities = player.getNearbyEntities(this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.X"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Y"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Z")); for (Entity entity : nearbyEntities) {