diff --git a/src/main/java/ac/grim/grimac/player/GrimPlayer.java b/src/main/java/ac/grim/grimac/player/GrimPlayer.java index ba95402c36..da3c6bb012 100644 --- a/src/main/java/ac/grim/grimac/player/GrimPlayer.java +++ b/src/main/java/ac/grim/grimac/player/GrimPlayer.java @@ -367,7 +367,6 @@ public void sendTransaction(boolean async) { lastTransSent = System.currentTimeMillis(); short transactionID = (short) (-1 * (transactionIDCounter.getAndIncrement() & 0x7FFF)); try { - addTransactionSend(transactionID); PacketWrapper packet; if (PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_17)) { @@ -377,8 +376,12 @@ public void sendTransaction(boolean async) { } if (async) { - ChannelHelper.runInEventLoop(user.getChannel(), () -> user.writePacket(packet)); + ChannelHelper.runInEventLoop(user.getChannel(), () -> { + addTransactionSend(transactionID); + user.writePacket(packet); + }); } else { + addTransactionSend(transactionID); user.writePacket(packet); } } catch (