Made PreLogEvent cancellable (implements #325)
This commit is contained in:
parent
e7a6f21d88
commit
1a06e6a6bf
11 changed files with 84 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ import org.bukkit.event.HandlerList;
|
|||
public class CoreProtectPreLogEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled = false;
|
||||
private String user;
|
||||
|
||||
public CoreProtectPreLogEvent(String user) {
|
||||
|
|
@ -17,6 +18,14 @@ public class CoreProtectPreLogEvent extends Event {
|
|||
return user;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
public void setUser(String newUser) {
|
||||
if (newUser == null || newUser.isEmpty()) {
|
||||
throw new IllegalArgumentException("Invalid user");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue