From 280880d1639e1b23de50c71cb8bdd8b63d7fc02f Mon Sep 17 00:00:00 2001 From: Tahg Date: Wed, 23 Feb 2011 22:52:14 -0500 Subject: [PATCH] synchronize hashmap lookups --- src/main/java/net/minecraft/server/LongHashtable.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/LongHashtable.java b/src/main/java/net/minecraft/server/LongHashtable.java index 3ac02a3797..d3b1474c18 100644 --- a/src/main/java/net/minecraft/server/LongHashtable.java +++ b/src/main/java/net/minecraft/server/LongHashtable.java @@ -40,7 +40,9 @@ public class LongHashtable extends LongHash } public V get(long key) { - return containsKey(key) ? (V) cache.value : null; + synchronized(this) { + return containsKey(key) ? (V) cache.value : null; + } } public boolean containsKey(long key) {