Repository navigation
Add helper methods for vanilla-style command feedback - #14331
Strokkur424 wants to merge 19 commits into
Conversation
| @Override | ||
| default void sendFailure(final ComponentLike message) { | ||
| Preconditions.checkNotNull(message, "message cannot be null."); | ||
| this.getHandle().sendFailure(PaperAdventure.asVanilla(message.asComponent()), false); |
There was a problem hiding this comment.
well this comes from the base PR but not sure about ignore the default style used in vanilla, but its more a opinion... most of people who use this wanna custom messages so...
There was a problem hiding this comment.
We could theoretically just add an overload that does apply the style too. Maybe sendFailureStyled? Alternatively, could be a method parameter. Idk, whatever you think is best?
|
didn't really give much time for jmp to look at your review there before opening your own PR there I think sendSystemMessage would be a nicer name than sendReply or the old sendToTarget & the minimessage methods don't really seem necessary |
Minimessage methods are quite useful, including current ones on CommandSender, especially on just feedback as messages are often simple and defined in place in command handling |
Just for your and anyone else's information, jmp did tell me I may open a PR to supersede his. I wouldn't have done it otherwise 😅 |
I can change it to The MiniMessage methods mirror the style of the ones on |
| * <p>This currently includes checking for environments with suppressed output, | ||
| * {@link GameRules#SEND_COMMAND_FEEDBACK}, and {@link GameRules#LOG_ADMIN_COMMANDS}.</p> |
There was a problem hiding this comment.
Maybe we can extend a little this? (where this is mentioned)
maybe can be to much info but the logic for admins and console... its like
- Admins
- The gamerule for command feedback
- minecraft.admin.command_feedback permission (or op)
- Console
- The gamerule for log admin commands
- The silentCommandBlocks when source its not a comand block
but maybe its to much info for this... and maybe can be just a mention in the docs rather than here (?
There was a problem hiding this comment.
I've spent some time thinking about how one could properly word this, and I have come to the evaluation that I think the current paragraph for this is already good enough. Generally, I think it's logical that command feedback is only sent for players with the relevant permission (the docs have that permission documented, albeit the description is outdated).
not sure about the SystemMessage term in methods... all the use of that are internally and exposed with simple names like sendRawMessage, etc. For the MM i feel dont hurt have... we already has sendRichMessage |
Co-authored-by: Pedro <3602279+Doc94@users.noreply.github.com>
Supersedes #13058
Closes #12579
Changes over the original PR by jmp:
sendSystemMessagetosendReplysendSuccessJavadoc to replace deprecatedGameRulementions withGameRulessendRichReply,sendRichSuccess, andsendRichFailureoverloads, which accept MiniMessage and TagResolvers