-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathUserMailEvent.java
More file actions
58 lines (48 loc) · 1.36 KB
/
UserMailEvent.java
File metadata and controls
58 lines (48 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package net.essentialsx.api.v2.events;
import net.ess3.api.IUser;
import net.essentialsx.api.v2.services.mail.MailMessage;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when mail is sent to a {@link net.ess3.api.IUser IUser} by another player or the console.
*/
public class UserMailEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final IUser recipient;
private final MailMessage message;
private boolean canceled;
public UserMailEvent(IUser recipient, MailMessage message) {
this.recipient = recipient;
this.message = message;
}
/**
* Gets the recipient of this mail.
* @return the recipient.
*/
public IUser getRecipient() {
return recipient;
}
/**
* Gets the underlying {@link MailMessage} for this mail.
* @return the message.
*/
public MailMessage getMessage() {
return message;
}
@Override
public void setCancelled(boolean cancel) {
this.canceled = cancel;
}
@Override
public boolean isCancelled() {
return canceled;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}