-
Notifications
You must be signed in to change notification settings - Fork 5
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 new events that allow for better API usage #3
base: main
Are you sure you want to change the base?
Conversation
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Called when a town has been created by a player. |
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.
"is about to be created" or similar
public class TownCreateEvent extends TownPlayerEvent implements Cancellable { | ||
private static final HandlerList HANDLERS = new HandlerList(); | ||
|
||
private boolean cancelled; |
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.
Use lombok
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Called when a town has been disbanded by a player. |
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.
"is about to be" or similar
|
||
/** The player disbanding the town */ | ||
private final Player player; | ||
private boolean cancelled; |
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.
Use lombok
* Abstract event class for all town related events | ||
*/ | ||
public abstract class TownEvent extends Event { | ||
private final Town town; |
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.
Use lombok
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Called when a player left a town. |
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.
"is about to leave" or similar
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Called when a player has joined a town. |
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.
"is about to join" or similar
* If you cancel the event in this case, nothing happens. | ||
* </p> | ||
*/ | ||
public class TownPlayerJoinEvent extends TownPlayerEvent implements Cancellable { |
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.
This should also be fired on com.oxywire.oxytowns.command.commands.admin.town.TownAddPlayerCommand
/** | ||
* Called when a town has been disbanded by a player. | ||
*/ | ||
public class TownDisbandEvent extends TownPlayerEvent implements Cancellable { |
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.
This should also be fired on com.oxywire.oxytowns.command.commands.admin.town.TownDisbandCommand
public class TownDisbandEvent extends TownPlayerEvent implements Cancellable { | ||
private static final HandlerList HANDLERS = new HandlerList(); | ||
|
||
/** The player disbanding the town */ |
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.
Do we need this context? Towns will only ever be naturally disbanded by the mayor or a server admin
Made the adjustments. Thanks for the feedback. I apologize for the long wait. |
Adds some new events and improves the event API