/
NPCKnockbackEvent.java
55 lines (43 loc) · 1.23 KB
/
NPCKnockbackEvent.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
package net.citizensnpcs.api.event;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.util.Vector;
import net.citizensnpcs.api.npc.NPC;
public class NPCKnockbackEvent extends NPCEvent implements Cancellable {
private boolean cancelled;
private final Entity entity;
private final double strength;
private final Vector vector;
public NPCKnockbackEvent(NPC npc, double strength, Vector vector, Entity entity) {
super(npc);
this.entity = entity;
this.strength = strength;
this.vector = vector;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public Vector getKnockbackVector() {
return vector;
}
public Entity getKnockingBackEntity() {
return entity;
}
public double getStrength() {
return strength;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
public static HandlerList getHandlerList() {
return handlers;
}
private static final HandlerList handlers = new HandlerList();
}