package com.alttd.velocitychat.handlers; import com.alttd.chat.config.Config; import com.alttd.chat.database.Queries; import com.alttd.chat.managers.ChatUserManager; import com.alttd.chat.managers.PartyManager; import com.alttd.chat.managers.RegexManager; import com.alttd.chat.objects.ChatUser; import com.alttd.chat.objects.Mail; import com.alttd.chat.objects.Party; import com.alttd.chat.util.ALogger; import com.alttd.chat.util.Utility; import com.alttd.velocitychat.VelocityChat; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import org.jetbrains.annotations.Nullable; import java.util.*; public class ChatHandler { public void privateMessage(String sender, String target, String message) { UUID uuid = UUID.fromString(sender); ChatUser senderUser = ChatUserManager.getChatUser(uuid); Optional optionalPlayer = VelocityChat.getPlugin().getProxy().getPlayer(uuid); if(optionalPlayer.isEmpty()) return; Player player = optionalPlayer.get(); Optional optionalPlayer2 = VelocityChat.getPlugin().getProxy().getPlayer(target); if(optionalPlayer2.isEmpty()) return; Player player2 = optionalPlayer2.get(); ChatUser targetUser = ChatUserManager.getChatUser(player2.getUniqueId()); List