Using the CG object on chat

This means user data will be available (again) if talking from Discord, for example.
This commit is contained in:
Norbi Peti 2018-07-15 02:22:40 +02:00
parent 050fd88560
commit 01562bf769
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -104,9 +104,11 @@ public class ChatProcessing {
doFunStuff(sender, e, message);
ChatPlayer mp = null;
ChatPlayer mp;
if (player != null)
mp = TBMCPlayerBase.getPlayer(player.getUniqueId(), ChatPlayer.class);
else //Due to the online player map, getPlayer() can be more efficient than getAs()
mp = e.getUser().getAs(ChatPlayer.class); //May be null
Color colormode = channel.color;
if (mp != null && mp.OtherColorMode != null)