From ee33a57323d1efb1e6867e5bd7974e2a04097af5 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 15 May 2023 19:40:53 -0400 Subject: [PATCH] send Associated Data to all --- src/main/java/noppes/npcs/Server.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/noppes/npcs/Server.java b/src/main/java/noppes/npcs/Server.java index 82c43f490..ddf73ff0a 100644 --- a/src/main/java/noppes/npcs/Server.java +++ b/src/main/java/noppes/npcs/Server.java @@ -59,15 +59,17 @@ public class Server { } public static void sendAssociatedData(Entity entity, EnumPacketClient enu, Object... obs) { - ByteBuf buffer = Unpooled.buffer(); - try { - if(!fillBuffer(buffer, enu, obs)) - return; - TargetPoint point = new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 60); - CustomNpcs.Channel.sendToAllAround(new FMLProxyPacket(buffer,"CustomNPCs"), point); - } catch (IOException e) { - e.printStackTrace(); - } + CustomNPCsScheduler.runTack(() -> { + ByteBuf buffer = Unpooled.buffer(); + try { + if(!fillBuffer(buffer, enu, obs)) + return; + TargetPoint point = new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 60); + CustomNpcs.Channel.sendToAllAround(new FMLProxyPacket(buffer,"CustomNPCs"), point); + } catch (IOException e) { + e.printStackTrace(); + } + }); } public static void sendToAll(EnumPacketClient enu, Object... obs) { ByteBuf buffer = Unpooled.buffer();