-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add guide for AsyncChatEvent #264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also mention the use of ChatRenderer.viewerUnaware as something that should be used if the message will not be different depending on who is getting it. This is more performant because the message will only be rendered once per player it's being sent to.
- The `render` method is called when a chat message is sent to the player. | ||
- The `source` parameter is the player that sent the message. | ||
- The `sourceDisplayName` parameter is the display name of the player that sent the message. | ||
- The `message` parameter is the message that was sent. | ||
- The `viewer` parameter is the player that is receiving the message. | ||
|
||
Now that we understand how the renderer works, we can start using it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think before this happens, it needs to be made clear that the render method is something that plugins implement, they generally do not call it themselves. And they don't supply each of those arguments, its given to them when the render method is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do that in the next section.
0c7b068
to
a79b8c0
Compare
a79b8c0
to
571d0b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some comments on the fact that it is Asynchronous as well? Looks like a good addition though
571d0b9
to
7dbc5c8
Compare
I addressed the requested changes. |
7dbc5c8
to
9581396
Compare
I added a note regarding the event being async, added a tip about the usage of I did not yet change the last section. |
9581396
to
1a1802e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds a guide for the
AsyncChatEvent
as people seem to strugle with it. Especially with the renderer.