-
-
Notifications
You must be signed in to change notification settings - Fork 754
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 PlayerPlotChatEvent #3735
base: main
Are you sure you want to change the base?
Add PlayerPlotChatEvent #3735
Conversation
Looks good so far - Would be great to implement the CancellablePlotEvent as well. Therefor plugins using that event are able to force / cancel plot messages on their own, if that event already exist. |
/** | ||
* @since TODO | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* @since TODO | |
*/ |
This is an internal class.
import java.util.Set; | ||
|
||
/** | ||
* @since TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add since todo to the added methods too.
* | ||
* @return Set of PlotPlayer | ||
*/ | ||
public Set<PlotPlayer<?>> getRecipients() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be documented that
- the returned set can be modified
- the changes apply to who receives the message
Also, the PlotPlayer
should be at least marked as non-null here, as putting a null value into the set will throw an exception later.
Same applies for getSpies()
, and it's probably also worth to think about what should happen if a player is in both sets.
|
||
boolean force = plotChatEvent.getEventResult() == Result.FORCE; | ||
|
||
if (force || (plot.isDenied(plotPlayer.getUUID()) && !Permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be !force
, as the plot chat should happen if the result is FORCE
public class PlayerPlotChatEvent extends PlotEvent implements CancellablePlotEvent { | ||
|
||
private final PlotPlayer<?> player; | ||
private final String message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rather use an adventure component for the message?
The passed message as a string is before the translation of color codes etc happened. Would be more suitable to use the component which is used as the "msg" placeholder.
@jaapieaapie1 Would you like to address the feedback? |
Please take a moment and address the merge conflicts of your pull request. Thanks! |
Description
This pull request adds a new event that will be called after a player chats in plot chat.
Submitter Checklist
@since TODO
.