From 0b256d15b26feb7707bb8590e235c2f997626258 Mon Sep 17 00:00:00 2001 From: terrarier2111 <58695553+terrarier2111@users.noreply.github.com> Date: Sun, 15 Nov 2020 21:15:42 +0100 Subject: [PATCH] Created a local variable for ProxiedPlayers --- bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java index e077bc26e..99214132c 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java +++ b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java @@ -126,9 +126,10 @@ public class BungeePlugin extends Plugin implements ViaPlatform, @Override public ViaCommandSender[] getOnlinePlayers() { - ViaCommandSender[] array = new ViaCommandSender[getProxy().getPlayers().size()]; + Collection players = getProxy().getPlayers(); + ViaCommandSender[] array = new ViaCommandSender[players.size()]; int i = 0; - for (ProxiedPlayer player : getProxy().getPlayers()) { + for (ProxiedPlayer player : players) { array[i++] = new BungeeCommandSender(player); } return array;