9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-30 04:19:28 +00:00

view distance actually is used

This commit is contained in:
LoJoSho
2023-01-02 10:55:17 -06:00
parent eb1971cf7e
commit 8c3a62fd4f

View File

@@ -2,6 +2,7 @@ package com.hibiscusmc.hmccosmetics.util;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.comphenix.protocol.wrappers.WrappedSignedProperty;
import com.hibiscusmc.hmccosmetics.config.Settings;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -27,7 +28,8 @@ public class PlayerUtils {
public static List<Player> getNearbyPlayers(Location location) {
List<Player> players = new ArrayList<>();
for (Entity entity : location.getWorld().getNearbyEntities(location, 32, 32, 32)) {
int viewDistance = Settings.getViewDistance();
for (Entity entity : location.getWorld().getNearbyEntities(location, viewDistance, viewDistance, viewDistance)) {
if (entity instanceof Player) {
players.add((Player) entity);
}