use of com.bergerkiller.generated.net.minecraft.server.EntityPlayerHandle in project BKCommonLib by bergerhealer.
the class PlayerUtil method getNearbyPlayers.
/**
* Gets a (referenced) list of all players nearby another Player
*
* @param player to get the nearby players of
* @param radius to look around the player for other playrs
* @return list of nearby players
*/
public static List<Player> getNearbyPlayers(Player player, double radius) {
EntityPlayerHandle handle = CommonNMS.getHandle(player);
List<?> nearbyPlayerHandles = handle.getWorld().getRawEntitiesOfType(EntityPlayerHandle.T.getType(), handle.getBoundingBox().grow(radius, radius, radius));
return new ConvertingList<Player>(nearbyPlayerHandles, DuplexConversion.player);
}
Aggregations