/
ExhaustedNPCEvent.java
43 lines (34 loc) · 1.02 KB
/
ExhaustedNPCEvent.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
package net.aufdemrand.denizen.events;
import net.citizensnpcs.api.event.NPCEvent;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Bukkit event for when an NPC is exhausted. Exhausted NPCs cannot move
* until their hunger level is below maxhunger, as tracked by the HungerTrait
* provided by Denizen.
*
* @author Jeremy Schroeder
*
*/
public class ExhaustedNPCEvent extends NPCEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled = false;
public ExhaustedNPCEvent(NPC npc) {
super(npc);
}
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}