Add PlayerChatEvent on clients (#8432)

* Add PlayerChatEvent on clients

d32dd01097

Co-authored-by: buthed010203 <naguiar010203@gmail.com>

* Only fire when valid. (Currently deciding on whether or not to add ChatEvent without the player.)

---------

Co-authored-by: buthed010203 <naguiar010203@gmail.com>
This commit is contained in:
code-explorer786 2023-04-07 05:16:04 +07:00 committed by GitHub
parent 2b11e1fb1e
commit cdb9fa0d7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,10 +201,12 @@ public class NetClient implements ApplicationListener{
Sounds.chatMessage.play();
}
//display raw unformatted text above player head
if(playersender != null && unformatted != null){
//display raw unformatted text above player head
playersender.lastText(unformatted);
playersender.textFadeTime(1f);
Events.fire(new PlayerChatEvent(playersender, unformatted));
}
}