From 59fca0f43ee0d4937c4dd53c9e006300d8d6ceff Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 16 Jul 2014 14:41:24 +0200 Subject: [PATCH] Prefer to synchronize adding players. Does not seem to be strictly necessary, because the data is comparably light-weight and the data loss on some time slices would usually be small. Should be cleaner, as this is a seldom event (login, logout). --- .../nocheatplus/net/protocollib/FlyingFrequency.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/net/protocollib/FlyingFrequency.java b/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/net/protocollib/FlyingFrequency.java index ff9484dc..f2842b3a 100644 --- a/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/net/protocollib/FlyingFrequency.java +++ b/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/net/protocollib/FlyingFrequency.java @@ -37,7 +37,7 @@ public class FlyingFrequency extends PacketAdapter implements Listener, JoinLeav super(plugin, PacketType.Play.Client.FLYING); // TODO: How does POS and POS_LOOK relate/translate? } - private ActionFrequency addName(String name) { + private synchronized ActionFrequency addName(String name) { Map freqMap = new HashMap(this.freqMap); ActionFrequency freq = new ActionFrequency(5, 1000); freqMap.put(name, freq);