[Bleeding] Add ProjectileSource interface. Addresses BUKKIT-1038, BUKKIT-1156

By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
Bukkit/Spigot
2014-01-26 20:08:28 -05:00
parent b3c27cf60d
commit 03235e2288
6 changed files with 87 additions and 21 deletions

View File

@@ -1,26 +1,41 @@
package org.bukkit.entity;
import org.bukkit.block.Dispenser;
import org.bukkit.projectiles.ProjectileSource;
/**
* Represents a shootable entity
* Represents a shootable entity.
*/
public interface Projectile extends Entity {
/**
* Retrieve the shooter of this projectile. The returned value can be null
* for projectiles shot from a {@link Dispenser} for example.
*
* @return the {@link LivingEntity} that shot this projectile
* This method exists for legacy reasons to provide backwards
* compatibility. It will not exist at runtime and should not be used
* under any circumstances.
*/
public LivingEntity getShooter();
@Deprecated
public LivingEntity _INVALID_getShooter();
/**
* Set the shooter of this projectile
* Retrieve the shooter of this projectile.
*
* @param shooter the {@link LivingEntity} that shot this projectile
* @return the {@link ProjectileSource} that shot this projectile
*/
public void setShooter(LivingEntity shooter);
public ProjectileSource getShooter();
/**
* This method exists for legacy reasons to provide backwards
* compatibility. It will not exist at runtime and should not be used
* under any circumstances.
*/
@Deprecated
public void _INVALID_setShooter(LivingEntity shooter);
/**
* Set the shooter of this projectile.
*
* @param shooter the {@link ProjectileSource} that shot this projectile
*/
public void setShooter(ProjectileSource source);
/**
* Determine if this projectile should bounce or not when it hits.