[Bleeding] Added Block.breakNaturally and Block.getDrops

By: Zeerix <zeerix@draig.de>
This commit is contained in:
Bukkit/Spigot 2012-01-12 03:08:31 +01:00
parent e0c7fc6bf5
commit 4ad64ea3f5

View File

@ -1,9 +1,12 @@
package org.bukkit.block; package org.bukkit.block;
import java.util.Collection;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.inventory.ItemStack;
/** /**
* Represents a block. This is a live object, and only one Block may exist for * 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 * @return Location of block
*/ */
Location getLocation(); Location getLocation();
/** /**
@ -302,4 +304,35 @@ public interface Block {
* @return reaction * @return reaction
*/ */
PistonMoveReaction getPistonMoveReaction(); 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);
} }