Cache whether the server is on a proxy or not

Fix kick where ban message was displayed instead of kick message
This commit is contained in:
Taah
2023-08-24 22:36:14 -07:00
parent b0240ef46e
commit f97411ce09
5 changed files with 21 additions and 13 deletions

View File

@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
public class BungeeUtil
{
public static final boolean PROXIED_SERVER = isBungeeCord() || isVelocity();
public static boolean isBungeeCord()
{
return Bukkit.spigot().getSpigotConfig().getBoolean("settings.bungeecord");
@ -23,7 +24,7 @@ public class BungeeUtil
@SuppressWarnings("UnstableApiUsage")
public static void kickPlayer(Player player, Component message)
{
if (isBungeeCord() || isVelocity())
if (PROXIED_SERVER)
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("KickPlayer");