Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ComponentLike argument to #failWithAdventureComponent method #577

Closed
ipiepiepie opened this issue Jul 13, 2024 · 2 comments
Closed

Add ComponentLike argument to #failWithAdventureComponent method #577

ipiepiepie opened this issue Jul 13, 2024 · 2 comments
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release

Comments

@ipiepiepie
Copy link

Description

I'd like to send error messages, using my custom message class, which implements ComponentLike interface.

At the moment, my error handling in commands looks like this:

if (!player.hasTown())
    throw CommandAPIBukkit.failWithAdventureComponent(message(ERR_WITHOUT_TOWN).asComponent());

After implementing suggested feature, my error handling would be:

if (!player.hasTown())
    throw CommandAPIBukkit.failWithAdventureComponent(message(ERR_WITHOUT_TOWN));

The second option looks much easier and prettier.

Expected code

CommandAPIBukkit#failWithAdventureComponent(ComponentLike)

Extra details

No response

@Strokkur424
Copy link
Contributor

Seems like it might be a quick and easy feature to add, without any drawbacks. Good idea, I approve

@DerEchtePilz DerEchtePilz added the implemented for next release This has been implemented in the current dev build for the next public release label Jul 13, 2024
@DerEchtePilz
Copy link
Collaborator

Implemented in version 9.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release
Projects
None yet
Development

No branches or pull requests

3 participants