From ac1b00e2d55dd271513d750468453e9475c0109f Mon Sep 17 00:00:00 2001 From: OEOTYAN Date: Sun, 5 Jan 2025 18:32:24 +0800 Subject: [PATCH] fix: fix Player::sendMessage broadcast --- src/mc/network/packet/Packet.cpp | 4 ++-- src/mc/network/packet/Packet.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mc/network/packet/Packet.cpp b/src/mc/network/packet/Packet.cpp index d2dfd6255f..5166e98fcd 100644 --- a/src/mc/network/packet/Packet.cpp +++ b/src/mc/network/packet/Packet.cpp @@ -4,11 +4,11 @@ #include "mc/network/NetworkIdentifierWithSubId.h" #include "mc/network/packet/Packet.h" #include "mc/server/ServerLevel.h" -#include "mc/server/ServerPlayer.h" #include "mc/world/Minecraft.h" +#include "mc/world/actor/player/Player.h" #include "mc/world/level/dimension/Dimension.h" -void Packet::sendTo(ServerPlayer const& player) const { +void Packet::sendTo(Player const& player) const { sendToClient(player.getNetworkIdentifier(), player.getClientSubId()); } diff --git a/src/mc/network/packet/Packet.h b/src/mc/network/packet/Packet.h index f3a2bd790d..612da42c40 100644 --- a/src/mc/network/packet/Packet.h +++ b/src/mc/network/packet/Packet.h @@ -20,7 +20,6 @@ class ReadOnlyBinaryStream; // clang-format on class Player; -class ServerPlayer; class Actor; class BlockPos; struct NetworkIdentifierWithSubId; @@ -43,7 +42,7 @@ class Packet { * * @param player The server player to send the packet to. */ - LLAPI void sendTo(ServerPlayer const& player) const; + LLAPI void sendTo(Player const& player) const; /** * Send the packet to all relevant players in a 2D plane at a position in a given dimension.