diff --git a/src/main/java/net/minestom/server/utils/entity/EntityUtils.java b/src/main/java/net/minestom/server/utils/entity/EntityUtils.java index 44396cb1a..68d3cf547 100644 --- a/src/main/java/net/minestom/server/utils/entity/EntityUtils.java +++ b/src/main/java/net/minestom/server/utils/entity/EntityUtils.java @@ -1,13 +1,12 @@ package net.minestom.server.utils.entity; -import net.minestom.server.MinecraftServer; +import net.minestom.server.coordinate.Point; +import net.minestom.server.coordinate.Pos; import net.minestom.server.entity.Entity; import net.minestom.server.instance.Chunk; import net.minestom.server.instance.Instance; import net.minestom.server.instance.block.Block; import net.minestom.server.utils.chunk.ChunkUtils; -import net.minestom.server.coordinate.Point; -import net.minestom.server.coordinate.Pos; import org.jetbrains.annotations.NotNull; import java.util.function.Consumer; @@ -32,23 +31,6 @@ public final class EntityUtils { } } - public static boolean areVisible(@NotNull Entity ent1, @NotNull Entity ent2) { - if (ent1.getInstance() == null || ent2.getInstance() == null) - return false; - if (!ent1.getInstance().equals(ent2.getInstance())) - return false; - - final Chunk chunk = ent1.getInstance().getChunkAt(ent1.getPosition()); - final long[] visibleChunksEntity = ChunkUtils.getChunksInRange(ent2.getPosition(), MinecraftServer.getEntityViewDistance()); - for (long visibleChunk : visibleChunksEntity) { - final int chunkX = ChunkUtils.getChunkCoordX(visibleChunk); - final int chunkZ = ChunkUtils.getChunkCoordZ(visibleChunk); - if (chunk.getChunkX() == chunkX && chunk.getChunkZ() == chunkZ) - return true; - } - return false; - } - public static boolean isOnGround(@NotNull Entity entity) { final Chunk chunk = entity.getChunk(); if (chunk == null)