mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
perf: remove repeated logic when getting location viewers
PacketManager#getViewers already performs the distance <= 0 check
This commit is contained in:
@@ -389,13 +389,7 @@ public class HMCCPacketManager extends PacketManager {
|
|||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public static List<Player> getViewers(@NotNull Location location) {
|
public static List<Player> getViewers(@NotNull Location location) {
|
||||||
ArrayList<Player> viewers = new ArrayList<>();
|
return PacketManager.getViewers(location, Settings.getViewDistance());
|
||||||
if (Settings.getViewDistance() <= 0) {
|
|
||||||
viewers.addAll(location.getWorld().getPlayers());
|
|
||||||
} else {
|
|
||||||
viewers.addAll(PacketManager.getViewers(location, Settings.getViewDistance()));
|
|
||||||
}
|
|
||||||
return viewers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendPacket(Player player, PacketContainer packet) {
|
public static void sendPacket(Player player, PacketContainer packet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user