diff --git a/src/main/java/ac/grim/grimac/player/GrimPlayer.java b/src/main/java/ac/grim/grimac/player/GrimPlayer.java index bb2c015b7d..adeb278df7 100644 --- a/src/main/java/ac/grim/grimac/player/GrimPlayer.java +++ b/src/main/java/ac/grim/grimac/player/GrimPlayer.java @@ -49,6 +49,7 @@ import org.jetbrains.annotations.Nullable; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicInteger; @@ -67,7 +68,7 @@ public class GrimPlayer implements GrimUser { // Determining player ping // The difference between keepalive and transactions is that keepalive is async while transactions are sync public final Queue> transactionsSent = new ConcurrentLinkedQueue<>(); - public final List didWeSendThatTrans = Collections.synchronizedList(new ArrayList<>()); + public final Set didWeSendThatTrans = ConcurrentHashMap.newKeySet(); private final AtomicInteger transactionIDCounter = new AtomicInteger(0); public AtomicInteger lastTransactionSent = new AtomicInteger(0); public AtomicInteger lastTransactionReceived = new AtomicInteger(0);