Is the code in registerGlobalReceiver correct? #2358
-
I've been trying to debug an issue trying to use the networking API where I want to dynamically register for a message. But it doesn't work.
Should that not be For reference, registerChannel seems to do the correct thing:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
The javadoc says you are meant to unregister your previous handler before registering a new one.
That !replaced does look weird. But it is not the actual registration of the handler, which is the putIfAbsent(). The network addon registration has similar code but there it doesn't negate the replaced. |
Beta Was this translation helpful? Give feedback.
-
I think this is indeed a bug, usually hidden by global registrations happening before any players connect. |
Beta Was this translation helpful? Give feedback.
I think this is indeed a bug, usually hidden by global registrations happening before any players connect.