Bukkit had a decent API called "Conversations" where a Conversable would be able to converse with a plugin and vice versa.
The core of the Conversation was being able to use a Conversation to maintain a quasi transient ConversationContext that basically was a Map<String, Object> to contain information pertinent to the conversation in the context between the player and the plugin.
The API had quite a bit to use, and there are some plugins that have been able to use them more robustly for interactive chat-based menus, and to be honest, I'd like to see some form of this API in SpongeAPI.
Ideally, as the getConversationData(Object) is rather abstract, I'd prefer to see some use of DataQuery as keys. Of course, all of this is up for debate and discussion.
Did bukkit suppress chat and join messages while the conversation was displayed?
If so, should they be queued and released to the player when the conversation releases, or just discarded?
Did bukkit suppress chat and join messages while the conversation was displayed?
It depended on the Conversation itself. The ConversationFactory sets up the conversation whether the chat is passed through to the rest of the server, or whether the chat is "caught" by the conversation only. As for the other bit of chat from the server, I could imagine a "bouncer" like playback created when necessary.
Can't people implement this quite easily on their own?
Yes, but theres some advantage to having consistent look and feel between plugin UI.
Could this be achieved by setting the players MessageSink and redirecting their messages to a plugin?
https://github.com/SpongePowered/SpongeAPI/blob/411037993587ae6f46a875198efe13c766b745a0/src/main/java/org/spongepowered/api/util/command/CommandSource.java#L74
The only thing that seems strange is the requirement of a CommandSource to be the recipient of a message... Or would creating a plugin defined CommandSource be appropriate for this use..?
@ryantheleach It is achievable that way, but bucket had a nicer system where players didn't receive any chat while in the "conversation". @zml2008 would this be feasible with Text API and Messaging API?
@zml2008 is this still within the realm of possibility for 3.0?
Would this be better as a service, much like the Pagination service?
I am certainly interested in seeing a conversation API come to fruition. The Enjin Minecraft Plugin utilizes Bukkit's Conversation API, so we definitely see potential for this feature in Sponge.
@20zinnm It'd likely not be a service, as there's a lot involved with MessageChannels and such that require the client not to be alerted, but again, as most people have said, this is already feasible to implement directly in a plugin by itself. Perhaps @windy1 or @kashike can give light to seeing this possibly added in the future?
I'll look into this.
For reference: #1532
Most helpful comment
For reference: #1532