HelpChat / ChatChat

ChatChat - Coming Soon
MIT License
51 stars 33 forks source link

user-offline message is only used when receiver is vanished for sender. #140

Closed BlitzOffline closed 2 years ago

BlitzOffline commented 2 years ago

Currently the invalid-argument message is being send if the receiver is a ChatUser and that user is offline. We should be sending the user-offline message instead.

EDIT: We might want to register the ChatUser as a parameter with our own validator and stuff since right now I'm pretty sure triumph-cmds uses the SenderMapper we register when creating the BukkitCommandManager.

https://github.com/HelpChat/ChatChat/blob/6a38248a9c117c1befd88b8389f2097a0dca46e6/plugin/src/main/java/at/helpch/chatchat/ChatChatPlugin.java#L62

BlitzOffline commented 2 years ago

OK so I was really blind, and also this is really stupid but we register the argument in the registerCommands method.

https://github.com/HelpChat/ChatChat/blob/6a38248a9c117c1befd88b8389f2097a0dca46e6/plugin/src/main/java/at/helpch/chatchat/ChatChatPlugin.java#L190-L196

Anyways we need to add extra checks here. First of all, if player == null, we need to send the offline-player message instead.