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:
@@ -19,7 +19,7 @@ public enum EntityType {
|
||||
ENDER_SIGNAL("EyeOfEnderSignal", EnderSignal.class, 15),
|
||||
THROWN_EXP_BOTTLE("ThrownExpBottle", ThrownExpBottle.class, 17),
|
||||
PRIMED_TNT("PrimedTnt", TNTPrimed.class, 20),
|
||||
FALLING_BLOCK("FallingSand", FallingSand.class, 21, false),
|
||||
FALLING_BLOCK("FallingSand", FallingBlock.class, 21, false),
|
||||
MINECART("Minecart", Minecart.class, 40),
|
||||
BOAT("Boat", Boat.class, 41),
|
||||
CREEPER("Creeper", Creeper.class, 50),
|
||||
|
||||
43
paper-api/src/main/java/org/bukkit/entity/FallingBlock.java
Normal file
43
paper-api/src/main/java/org/bukkit/entity/FallingBlock.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Represents a falling block
|
||||
*/
|
||||
public interface FallingBlock extends Entity {
|
||||
/**
|
||||
* Get the Material of the falling block
|
||||
*
|
||||
* @return Material of the block
|
||||
*/
|
||||
Material getMaterial();
|
||||
|
||||
/**
|
||||
* Get the ID of the falling block
|
||||
*
|
||||
* @return ID type of the block
|
||||
*/
|
||||
int getBlockId();
|
||||
|
||||
/**
|
||||
* Get the data for the falling block
|
||||
*
|
||||
* @return data of the block
|
||||
*/
|
||||
byte getBlockData();
|
||||
|
||||
/**
|
||||
* Get if the falling block will break into an item if it cannot be placed
|
||||
*
|
||||
* @return true if the block will break into an item when obstructed
|
||||
*/
|
||||
boolean getDropItem();
|
||||
|
||||
/**
|
||||
* Set if the falling block will break into an item if it cannot be placed
|
||||
*
|
||||
* @param drop true to break into an item when obstructed
|
||||
*/
|
||||
void setDropItem(boolean drop);
|
||||
}
|
||||
@@ -2,5 +2,8 @@ package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a falling block.
|
||||
*
|
||||
* @deprecated See {@link FallingBlock}
|
||||
*/
|
||||
public interface FallingSand extends Entity {}
|
||||
@Deprecated
|
||||
public interface FallingSand extends FallingBlock {}
|
||||
|
||||
Reference in New Issue
Block a user