Revxrsal / Lamp

A modern annotations-driven commands framework for Java and Kotlin
MIT License
202 stars 38 forks source link

[Feature] Custom message types in Locale/Translator #75

Closed bivashy closed 1 month ago

bivashy commented 11 months ago

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.

Revxrsal commented 10 months ago

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.

Revxrsal commented 1 month ago

Addressed in v4. Thanks.