From b0ed4d6abebf2a8a6bcda33f3248723671a00cf3 Mon Sep 17 00:00:00 2001 From: RayzsYT <51991564+RayzsYT@users.noreply.github.com> Date: Tue, 14 May 2024 15:31:31 +0200 Subject: [PATCH] Better Data Sync --- .../rayzs/pat/utils/communication/impl/VelocityClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/rayzs/pat/utils/communication/impl/VelocityClient.java b/src/main/java/de/rayzs/pat/utils/communication/impl/VelocityClient.java index 9aa946b0..d9ec5cba 100644 --- a/src/main/java/de/rayzs/pat/utils/communication/impl/VelocityClient.java +++ b/src/main/java/de/rayzs/pat/utils/communication/impl/VelocityClient.java @@ -3,8 +3,10 @@ package de.rayzs.pat.utils.communication.impl; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.PluginMessageEvent; import com.velocitypowered.api.proxy.ProxyServer; +import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.api.proxy.server.RegisteredServer; +import com.velocitypowered.api.proxy.server.ServerInfo; import de.rayzs.pat.plugin.VelocityLoader; import de.rayzs.pat.utils.communication.Client; import de.rayzs.pat.utils.communication.ClientCommunication; @@ -41,7 +43,8 @@ public class VelocityClient implements Client { try { DataInputStream input = new DataInputStream(new ByteArrayInputStream(event.getData())); String information = input.readUTF(); - ClientCommunication.receiveInformation(information); + ServerConnection server = (ServerConnection) event.getSource(); + ClientCommunication.receiveInformation(server.getServerInfo().getName(), information); } catch (Throwable throwable) { throwable.printStackTrace(); } } }