-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
SentinelAttackEvent.java
59 lines (50 loc) · 1.32 KB
/
SentinelAttackEvent.java
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
59
package org.mcmonkey.sentinel.events;
import net.citizensnpcs.api.event.NPCEvent;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Event fired when a Sentinel NPC is going to attack.
*/
public class SentinelAttackEvent extends NPCEvent implements Cancellable {
/**
* Handler objects, for Bukkit internal usage.
*/
private static final HandlerList handlers = new HandlerList();
/**
* Whether the event is cancelled.
*/
private boolean cancelled = false;
/**
* Constructs the attack event.
*/
public SentinelAttackEvent(NPC npc) {
super(npc);
}
/**
* Returns the handler list for use with Bukkit.
*/
public HandlerList getHandlers() {
return handlers;
}
/**
* Returns the handler list for use with Bukkit.
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Returns whether the event is cancelled.
*/
@Override
public boolean isCancelled() {
return cancelled;
}
/**
* Sets whether the event is cancelled.
*/
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}