From b188899164b1af314d7028702da8609c52b1fa67 Mon Sep 17 00:00:00 2001 From: mrsterner Date: Thu, 19 Dec 2024 14:40:20 +0100 Subject: [PATCH] lose yourself to the payload --- .../com/sammy/malum/registry/common/PacketRegistry.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/sammy/malum/registry/common/PacketRegistry.java b/src/main/java/com/sammy/malum/registry/common/PacketRegistry.java index 92736af12..c95a3ad6c 100644 --- a/src/main/java/com/sammy/malum/registry/common/PacketRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/PacketRegistry.java @@ -120,12 +120,18 @@ public static void sendToPlayersTrackingEntityAndSelf(LivingEntity e, CustomPack for (ServerPlayer player : PlayerLookup.tracking(e)) { ServerPlayNetworking.send(player, payload); } + if (e instanceof ServerPlayer self) { + ServerPlayNetworking.send(self, payload); + } } public static void sendToPlayersTrackingEntityAndSelf(Entity e, CustomPacketPayload payload) { for (ServerPlayer player : PlayerLookup.tracking(e)) { ServerPlayNetworking.send(player, payload); } + if (e instanceof ServerPlayer self) { + ServerPlayNetworking.send(self, payload); + } } public static void sendToPlayersTrackingChunk(ServerLevel level, ChunkPos chunkPos, CustomPacketPayload payload) {