use of com.laytonsmith.abstraction.MCEntity in project CommandHelper by EngineHub.
the class BukkitEntityListener method onTargetLiving.
@EventIdentifier(event = Driver.TARGET_ENTITY, className = "org.bukkit.event.entity.EntityTargetEvent")
public void onTargetLiving(Event event) {
BukkitMCTargetEvent ete = new BukkitMCTargetEvent(event);
MCEntity target = ete.getTarget();
if (target == null || !(target instanceof MCPlayer)) {
return;
}
EventUtils.TriggerListener(Driver.TARGET_ENTITY, "target_player", ete);
}
use of com.laytonsmith.abstraction.MCEntity in project CommandHelper by EngineHub.
the class BukkitMCEntity method getNearbyEntities.
@Override
public List<MCEntity> getNearbyEntities(double x, double y, double z) {
List<Entity> lst = e.getNearbyEntities(x, y, z);
List<MCEntity> retn = new ArrayList<>();
for (Entity e : lst) {
retn.add(BukkitConvertor.BukkitGetCorrectEntity(e));
}
return retn;
}
use of com.laytonsmith.abstraction.MCEntity in project CommandHelper by EngineHub.
the class BukkitMCBlockProjectileSource method launchProjectile.
@Override
public MCProjectile launchProjectile(MCProjectileType projectile, Vector3D init) {
EntityType et = EntityType.valueOf(projectile.name());
Class<? extends Entity> c = et.getEntityClass();
Vector vector = new Vector(init.X(), init.Y(), init.Z());
Projectile proj = bps.launchProjectile(c.asSubclass(Projectile.class), vector);
MCEntity e = BukkitConvertor.BukkitGetCorrectEntity(proj);
if (e instanceof MCProjectile) {
return (MCProjectile) e;
} else {
return null;
}
}
use of com.laytonsmith.abstraction.MCEntity in project CommandHelper by EngineHub.
the class BukkitMCEntityProjectileSource method launchProjectile.
@Override
public MCProjectile launchProjectile(MCProjectileType projectile, Vector3D init) {
EntityType et = EntityType.valueOf(projectile.name());
Class<? extends Entity> c = et.getEntityClass();
Vector vector = new Vector(init.X(), init.Y(), init.Z());
Projectile proj = eps.launchProjectile(c.asSubclass(Projectile.class), vector);
MCEntity mcproj = BukkitConvertor.BukkitGetCorrectEntity(proj);
if (mcproj instanceof MCProjectile) {
return (MCProjectile) mcproj;
} else {
return null;
}
}
use of com.laytonsmith.abstraction.MCEntity in project CommandHelper by EngineHub.
the class BukkitMCEntityProjectileSource method launchProjectile.
@Override
public MCProjectile launchProjectile(MCProjectileType projectile) {
EntityType et = EntityType.valueOf(projectile.name());
Class<? extends Entity> c = et.getEntityClass();
Projectile proj = eps.launchProjectile(c.asSubclass(Projectile.class));
MCEntity mcproj = BukkitConvertor.BukkitGetCorrectEntity(proj);
if (mcproj instanceof MCProjectile) {
return (MCProjectile) mcproj;
} else {
return null;
}
}
Aggregations