summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorZeerix <zeerix@draig.de>2012-01-12 03:08:31 +0100
committerErik Broes <erikbroes@grum.nl>2012-01-17 19:48:36 +0100
commitd384da1e7c93e35042a1d66d8f81b1aa98be3fb5 (patch)
tree0515921fd804019e65d2f2835ae267ebca62f951 /src/main
parent86f33b82c90eaaabb8def515462e7e6100d052ab (diff)
downloadbukkit-d384da1e7c93e35042a1d66d8f81b1aa98be3fb5.tar
bukkit-d384da1e7c93e35042a1d66d8f81b1aa98be3fb5.tar.gz
bukkit-d384da1e7c93e35042a1d66d8f81b1aa98be3fb5.tar.lz
bukkit-d384da1e7c93e35042a1d66d8f81b1aa98be3fb5.tar.xz
bukkit-d384da1e7c93e35042a1d66d8f81b1aa98be3fb5.zip
[Bleeding] Added Block.breakNaturally and Block.getDrops
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/block/Block.java35
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);
+
}