Lamp
Lamp copied to clipboard
[Feature] Custom message types in Locale/Translator
Description:
I've always wanted to utilize the Locale feature to offer users multi-language messages. However, there's a primary issue: it doesn't support custom message types, such as Component
. Due to this limitation, we cannot send clickable/hoverable messages to our BukkitCommandActor
.
Solution:
We could create another interface that extends LocaleReader
called LocaleReaderTransmitter
, which would implement the LocaleReaderTransmitter#sendToActor(CommandActor)
method.
Alternatives I've Considered:
I've tried using CommandExceptionAdapter
and BukkitExceptionAdapter
, but I'm not happy with that approach. That's because replyLocalized
or errorLocalized
still utilize the LocaleReader
that only supports strings.
Hmm, the implementation is indeed quite limited. Have you considered ResponseHandlers though? I'll see if I could scrape a simple API for getting that job done.
Addressed in v4. Thanks.