geforkt von Mirrors/Paper
[Bleeding] Added launchProjectile.
Use launchProjectile in place of individual throwSnowball, throwEgg, and shootArrow methods By: aPunch <alexpuncochar@yahoo.com>
Dieser Commit ist enthalten in:
Ursprung
6e054ddf7f
Commit
7046df03bc
@ -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.
|
||||
*
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@ -650,6 +651,10 @@ public class TestPlayer implements Player {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
return EntityType.PLAYER;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren