From 90d2ebdb52b75d302cb37cf62e162c26c5565141 Mon Sep 17 00:00:00 2001 From: SamB440 Date: Sat, 17 Aug 2024 15:02:31 +0100 Subject: [PATCH] Lag compensate Play.Server.Tags --- .../ac/grim/grimac/events/packets/PacketServerTags.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/ac/grim/grimac/events/packets/PacketServerTags.java b/src/main/java/ac/grim/grimac/events/packets/PacketServerTags.java index 20e7139148..8e887cacfc 100644 --- a/src/main/java/ac/grim/grimac/events/packets/PacketServerTags.java +++ b/src/main/java/ac/grim/grimac/events/packets/PacketServerTags.java @@ -16,7 +16,13 @@ public void onPacketSend(PacketSendEvent event) { if (player == null) return; WrapperPlayServerTags tags = new WrapperPlayServerTags(event); - player.tagManager.handleTagSync(tags); + final boolean isPlay = event.getPacketType() == PacketType.Play.Server.TAGS; + if (isPlay) { + player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(), () -> player.tagManager.handleTagSync(tags)); + } else { + // This is during configuration stage, player isn't even in the game yet so no need to lag compensate. + player.tagManager.handleTagSync(tags); + } } } }