diff options
-rw-r--r-- | src/main/java/org/bukkit/block/Block.java | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java index 1d6b6b67..0ca2622c 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -1,9 +1,12 @@ package org.bukkit.block; +import java.util.Collection; + import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.Location; +import org.bukkit.inventory.ItemStack; /** * Represents a block. This is a live object, and only one Block may exist for @@ -143,7 +146,6 @@ public interface Block { * * @return Location of block */ - Location getLocation(); /** @@ -302,4 +304,35 @@ public interface Block { * @return reaction */ PistonMoveReaction getPistonMoveReaction(); + + /** + * Breaks the block and spawns items as if a player had digged it + * + * @return true if the block was destroyed + */ + boolean breakNaturally(); + + /** + * Breaks the block and spawns items as if a player had digged it with a specific tool + * + * @param tool The tool or item in hand used for digging + * @return true if the block was destroyed + */ + boolean breakNaturally(ItemStack tool); + + /** + * Returns a list of items which would drop by destroying this block + * + * @return a list of dropped items for this type of block + */ + Collection<ItemStack> getDrops(); + + /** + * Returns a list of items which would drop by destroying this block with a specific tool + * + * @param tool The tool or item in hand used for digging + * @return a list of dropped items for this type of block + */ + Collection<ItemStack> getDrops(ItemStack tool); + } |