Added a general spawn method.

By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
Bukkit/Spigot 2011-06-08 15:50:22 -07:00
parent e1ffe6625c
commit bdcef14cde

View file

@ -275,7 +275,9 @@ public interface World {
*
* @param location Location to spawn the minecart
* @return Minecart created as a result of this method
* @deprecated use {@link #spawn(Location, Class)} instead
*/
@Deprecated
public Minecart spawnMinecart(Location location);
/**
@ -283,7 +285,9 @@ public interface World {
*
* @param loc Location to spawn the minecart
* @return StorageMinecart created as a result of this method
* @deprecated use {@link #spawn(Location, Class)} instead
*/
@Deprecated
public StorageMinecart spawnStorageMinecart(Location loc);
/**
@ -291,7 +295,9 @@ public interface World {
*
* @param loc Location to spawn the minecart
* @return PoweredMinecart created as a result of this method
* @deprecated use {@link #spawn(Location, Class)} instead
*/
@Deprecated
public PoweredMinecart spawnPoweredMinecart(Location loc);
/**
@ -299,7 +305,9 @@ public interface World {
*
* @param loc Location to spawn the boat
* @return Boat created as a result of this method
* @deprecated use {@link #spawn(Location, Class)} instead
*/
@Deprecated
public Boat spawnBoat(Location loc);
/**
@ -571,6 +579,16 @@ public interface World {
*/
public List<BlockPopulator> getPopulators();
/**
* Spawn an entity of a specific class at the given {@link Location}
*
* @param location the {@link Location} to spawn the entity at
* @param clazz the class of the {@link Entity} to spawn
* @return an instance of the spawned {@link Entity}
* @throws an {@link IllegalArgumentException} if either parameter is null or the {@link Entity} requested cannot be spawned
*/
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException;
/**
* Plays an effect to all players within a default radius around a given location.
*