From 09ab39a23831b96e3596d1916e98693f45719312 Mon Sep 17 00:00:00 2001 From: Uristqwerty Date: Mon, 24 Dec 2012 20:40:09 -0500 Subject: [PATCH] Force parent ListenerListInsts to rebuild. Without this change, it is possible (and, in fact, nearly guaranteed) for lists to rebuild endlessly if a parent list is marked as needing a rebuild but never actually read. This change forces the parent list(s) to rebuild as well, resulting in a significant performance increase and smoother framerate due to greatly reduced GC activity. --- common/net/minecraftforge/event/ListenerList.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/net/minecraftforge/event/ListenerList.java b/common/net/minecraftforge/event/ListenerList.java index b88a4c86e..7600d777c 100644 --- a/common/net/minecraftforge/event/ListenerList.java +++ b/common/net/minecraftforge/event/ListenerList.java @@ -185,6 +185,11 @@ public class ListenerList */ private void buildCache() { + if(parent != null && parent.shouldRebuild()) + { + parent.buildCache(); + } + ArrayList ret = new ArrayList(); for (EventPriority value : EventPriority.values()) {