This commit is contained in:
Logan Magnan 2024-09-22 10:17:21 -04:00
parent 2998bbf24b
commit 9706c830e4
2 changed files with 6 additions and 1 deletions

View File

@ -74,7 +74,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -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<Entity> 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) {