Skip to content

Commit bb81df7

Browse files
committed
Fix ListenerList not firing when parent has a listener before child is created.
1 parent 49c8162 commit bb81df7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/net/minecraftforge/eventbus/ListenerList.java

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ private ListenerListInst() {}
121121
private ListenerListInst(ListenerListInst parent) {
122122
this.parent = parent;
123123
this.parent.addChild(this);
124+
// We set the NO_LISTENERS so we don't have to rebuild the listener list if nobody registers
125+
// However the parent can have a listener registered before we know about the sub-class
126+
if (this.parent.listeners != NO_LISTENERS)
127+
this.listeners = null;
124128
}
125129

126130
public void dispose() {

0 commit comments

Comments
 (0)