From 970be7a444aa6b0dfac624b4633a8b5fe535c2ec Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 22 Mar 2015 19:06:55 +0000 Subject: Fix thread safety issues in EntitySlice --- nms-patches/EntitySlice.patch | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 nms-patches/EntitySlice.patch diff --git a/nms-patches/EntitySlice.patch b/nms-patches/EntitySlice.patch new file mode 100644 index 00000000..d8d2c985 --- /dev/null +++ b/nms-patches/EntitySlice.patch @@ -0,0 +1,38 @@ +--- /home/matt/mc-dev-private//net/minecraft/server/EntitySlice.java 2015-03-22 19:06:47.125875941 +0000 ++++ src/main/java/net/minecraft/server/EntitySlice.java 2015-03-22 19:06:47.125875941 +0000 +@@ -12,7 +12,7 @@ + + public class EntitySlice extends AbstractSet { + +- private static final Set> a = Sets.newHashSet(); ++ private static final Set> a = Sets.newConcurrentHashSet(); // CraftBukkit + private final Map, List> b = Maps.newHashMap(); + private final Set> c = Sets.newIdentityHashSet(); + private final Class d; +@@ -40,7 +40,7 @@ + Object object = iterator.next(); + + if (oclass.isAssignableFrom(object.getClass())) { +- this.a(object, oclass); ++ this.a((T) object, oclass); + } + } + +@@ -77,7 +77,7 @@ + List list = (List) this.b.get(oclass); + + if (list == null) { +- this.b.put(oclass, Lists.newArrayList(new Object[] { t0})); ++ this.b.put(oclass, Lists.newArrayList(t0)); + } else { + list.add(t0); + } +@@ -125,7 +125,7 @@ + } + + public Iterator iterator() { +- return this.e.isEmpty() ? Iterators.emptyIterator() : Iterators.unmodifiableIterator(this.e.iterator()); ++ return this.e.isEmpty() ? Iterators.emptyIterator() : Iterators.unmodifiableIterator(this.e.iterator()); + } + + public int size() { -- cgit v1.2.3