Add interface for spawning FallingBlocks and correctly spawn a FallingBlock with the spawn(Location, FallingBlock.class) method. Adds BUKKIT-2282
Also add FallingBlock and methods. Deprecated FallingSand to emphasize FallingBlock. By: feildmaster <admin@feildmaster.com>
This commit is contained in:
@@ -629,6 +629,32 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
*/
|
||||
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Spawn a {@link FallingBlock} entity at the given {@link Location} of the specified {@link Material}.
|
||||
* The material dictates what is falling. When the FallingBlock hits the ground, it will place that block.
|
||||
* <p />
|
||||
* The Material must be a block type, check with {@link Material#isBlock() material.isBlock()}.
|
||||
* The Material may not be air.
|
||||
*
|
||||
* @param location The {@link Location} to spawn the FallingBlock
|
||||
* @param material The block {@link Material} type
|
||||
* @param data The block data
|
||||
* @return The spawned {@link FallingBlock} instance
|
||||
* @throws IllegalArgumentException if {@link Location} or {@link Material} are null or {@link Material} is not a block
|
||||
*/
|
||||
public FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Spawn a {@link FallingBlock} entity at the given {@link Location} of the specified blockId (converted to {@link Material})
|
||||
*
|
||||
* @param location The {@link Location} to spawn the FallingBlock
|
||||
* @param blockId see {@see #spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)} material
|
||||
* @param blockData The block data
|
||||
* @return The spawned FallingBlock instance
|
||||
* @throws IllegalArgumentException see {@see #spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)}
|
||||
*/
|
||||
public FallingBlock spawnFallingBlock(Location location, int blockId, byte blockData) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Plays an effect to all players within a default radius around a given location.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user