diff options
-rw-r--r-- | src/main/java/org/bukkit/World.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 99098d9b..d979d643 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -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); /** @@ -572,6 +580,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. * * @param location the {@link Location} around which players must be to hear the sound |