Fix up possible CME
This commit is contained in:
parent
8a69b17bd6
commit
e05d6340d7
1 changed files with 12 additions and 4 deletions
|
@ -1,11 +1,12 @@
|
|||
package cpw.mods.fml.common.eventhandler;
|
||||
|
||||
import java.util.*;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
|
||||
public class ListenerList
|
||||
{
|
||||
private static ArrayList<ListenerList> allLists = new ArrayList<ListenerList>();
|
||||
private static ImmutableList<ListenerList> allLists = ImmutableList.of();
|
||||
private static int maxSize = 0;
|
||||
|
||||
private ListenerList parent;
|
||||
|
@ -13,15 +14,22 @@ public class ListenerList
|
|||
|
||||
public ListenerList()
|
||||
{
|
||||
allLists.add(this);
|
||||
extendMasterList(this);
|
||||
resizeLists(maxSize);
|
||||
}
|
||||
|
||||
public ListenerList(ListenerList parent)
|
||||
{
|
||||
allLists.add(this);
|
||||
this();
|
||||
this.parent = parent;
|
||||
resizeLists(maxSize);
|
||||
}
|
||||
|
||||
private synchronized static void extendMasterList(ListenerList inst)
|
||||
{
|
||||
ImmutableList.Builder<ListenerList> builder = ImmutableList.builder();
|
||||
builder.addAll(allLists);
|
||||
builder.add(inst);
|
||||
allLists = builder.build();
|
||||
}
|
||||
|
||||
public static void resize(int max)
|
||||
|
|
Loading…
Reference in a new issue