Skip to content

Commit

Permalink
Clean up some world events dealing with entities.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Sep 15, 2013
1 parent a2c1620 commit 12c804c
Show file tree
Hide file tree
Showing 2 changed files with 270 additions and 245 deletions.
43 changes: 43 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -32,6 +32,7 @@
import org.bukkit.entity.Ocelot;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Sheep;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Slime;
Expand Down Expand Up @@ -334,6 +335,17 @@ public NPC getNPC() {

return CitizensAPI.getNPCRegistry().getNPC(entity);
}

/**
* Get the dNPC corresponding to this entity
*
* @return The dNPC
*/

public dNPC getDenizenNPC() {

return new dNPC(getNPC());
}

/**
* Check whether this entity is an NPC
Expand Down Expand Up @@ -365,6 +377,37 @@ public Player getPlayer() {
public boolean isPlayer() {
return entity instanceof Player;
}

/**
* Get this entity as a Projectile
*
* @return true or false
*/

public Projectile getProjectile() {

return (Projectile) entity;
}

/**
* Check whether this entity is a Projectile
*
* @return true or false
*/

public boolean isProjectile() {
return entity instanceof Projectile;
}

/**
* Get this entity's shooter
*
* @return true or false
*/

public dEntity getShooter() {
return new dEntity(getProjectile().getShooter());
}

/**
* Whether this entity identifies as a generic
Expand Down

0 comments on commit 12c804c

Please sign in to comment.