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 1/2] 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; From 6a12f8139c5d0970ec34b51f7c173419717701d2 Mon Sep 17 00:00:00 2001 From: terrarier2111 <58695553+terrarier2111@users.noreply.github.com> Date: Sat, 21 Nov 2020 19:26:10 +0100 Subject: [PATCH 2/2] Added missing import --- bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java index 99214132c..bf7f1ff01 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java +++ b/bungee/src/main/java/us/myles/ViaVersion/BungeePlugin.java @@ -28,6 +28,7 @@ import us.myles.ViaVersion.util.GsonUtil; import java.util.ArrayList; import java.util.Collections; +import java.util.Collection; import java.util.List; import java.util.UUID; import java.util.concurrent.TimeUnit;