From 52e3da1e6ef5b783f790e282f242e6d8b6c7dc20 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 19 Jun 2022 13:00:23 +0200 Subject: [PATCH] Move network to own threads Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/network/NetworkReceiver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/network/NetworkReceiver.java b/src/de/steamwar/bungeecore/network/NetworkReceiver.java index b089141..d3de8c8 100644 --- a/src/de/steamwar/bungeecore/network/NetworkReceiver.java +++ b/src/de/steamwar/bungeecore/network/NetworkReceiver.java @@ -23,6 +23,7 @@ import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.commands.TeamCommand; import de.steamwar.bungeecore.listeners.BasicListener; import de.steamwar.network.packets.NetworkPacket; +import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.Server; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.event.EventHandler; @@ -51,6 +52,6 @@ public class NetworkReceiver extends BasicListener { if(!(event.getSender() instanceof Server)) return; - NetworkPacket.handle(new ServerMetaInfo(((Server) event.getSender()).getInfo()), event.getData()); + ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> NetworkPacket.handle(new ServerMetaInfo(((Server) event.getSender()).getInfo()), event.getData())); } }