-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
NPCCombustEvent.java
57 lines (46 loc) · 1.4 KB
/
NPCCombustEvent.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
package net.citizensnpcs.api.event;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityCombustEvent;
public class NPCCombustEvent extends NPCEvent implements Cancellable {
private boolean cancelled;
private final EntityCombustEvent event;
public NPCCombustEvent(EntityCombustEvent event, NPC npc) {
super(npc);
this.event = event;
}
/**
* @return the amount of time (in seconds) the combustee should be alight for
*/
public int getDuration() {
return event.getDuration();
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
/**
* The number of seconds the combustee should be alight for.
* <p />
* This value will only ever increase the combustion time, not decrease existing combustion times.
*
* @param duration
* the time in seconds to be alight for.
*/
public void setDuration(int duration) {
event.setDuration(duration);
}
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
}