Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/main/java/net/citizensnpcs/api/event/NPCKnockbackEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package net.citizensnpcs.api.event; | ||
|
||
import org.bukkit.event.HandlerList; | ||
import org.bukkit.util.Vector; | ||
|
||
import net.citizensnpcs.api.npc.NPC; | ||
|
||
public class NPCKnockbackEvent extends NPCEvent { | ||
private double strength; | ||
private Vector vector; | ||
|
||
public NPCKnockbackEvent(NPC npc, double impulse, double dx, double dz) { | ||
super(npc); | ||
this.strength = impulse; | ||
this.vector = new Vector(dx, 0, dz); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public Vector getKnockbackVector() { | ||
return vector; | ||
} | ||
|
||
public double getStrength() { | ||
return strength; | ||
} | ||
|
||
public void setKnockbackVector(Vector vector) { | ||
this.vector = vector; | ||
} | ||
|
||
public void setStrength(double strength) { | ||
this.strength = strength; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
} |