Skip to content

Commit

Permalink
Lag compensate Play.Server.Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Aug 17, 2024
1 parent b391705 commit 90d2ebd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}

0 comments on commit 90d2ebd

Please sign in to comment.