[Bleeding] Added launchProjectile.

Use launchProjectile in place of individual throwSnowball, throwEgg, and shootArrow methods

By: aPunch <alexpuncochar@yahoo.com>
This commit is contained in:
Bukkit/Spigot
2012-02-16 15:14:12 -06:00
parent 6e054ddf7f
commit 7046df03bc
2 changed files with 20 additions and 0 deletions

View File

@@ -90,24 +90,39 @@ public interface LivingEntity extends Entity {
/**
* Throws an egg from the entity.
*
* @deprecated Use launchProjectile(Egg.class) instead
* @return The egg thrown.
*/
@Deprecated
public Egg throwEgg();
/**
* Throws a snowball from the entity.
*
* @deprecated Use launchProjectile(Snowball.class) instead
* @return The snowball thrown.
*/
@Deprecated
public Snowball throwSnowball();
/**
* Shoots an arrow from the entity.
*
* @deprecated Use launchProjectile(Arrow.class) instead
* @return The arrow shot.
*/
@Deprecated
public Arrow shootArrow();
/**
* Launches a {@link Projectile} from the entity.
*
* @param projectile Class of the projectile to launch
*
* @return The launched projectile.
*/
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile);
/**
* Returns whether this entity is inside a vehicle.
*