mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 04:28:21 +01:00
Do not send packet to empty collection
This commit is contained in:
parent
98fe83c605
commit
871cb993b4
@ -39,6 +39,9 @@ public final class PacketUtils {
|
|||||||
* @param packet the packet to send to the players
|
* @param packet the packet to send to the players
|
||||||
*/
|
*/
|
||||||
public static void sendGroupedPacket(@NotNull Collection<Player> players, @NotNull ServerPacket packet) {
|
public static void sendGroupedPacket(@NotNull Collection<Player> players, @NotNull ServerPacket packet) {
|
||||||
|
if (players.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
final boolean success = PACKET_LISTENER_MANAGER.processServerPacket(packet, players);
|
final boolean success = PACKET_LISTENER_MANAGER.processServerPacket(packet, players);
|
||||||
if (success) {
|
if (success) {
|
||||||
final ByteBuf finalBuffer = createFramedPacket(packet);
|
final ByteBuf finalBuffer = createFramedPacket(packet);
|
||||||
|
Loading…
Reference in New Issue
Block a user