From 2b8fb83fd8d30c049b9e4fb44407e7eab3a053fe Mon Sep 17 00:00:00 2001 From: Flo0 Date: Wed, 21 Apr 2021 17:31:45 +1000 Subject: [PATCH] #601: Add Block#isPreferredTool --- src/main/java/org/bukkit/block/Block.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java index 0cfad6f8..d4c69573 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -430,6 +430,17 @@ public interface Block extends Metadatable { @NotNull Collection getDrops(@NotNull ItemStack tool, @Nullable Entity entity); + /** + * Returns if the given item is a preferred choice to break this Block. + * + * In some cases this determines if a block will drop anything or extra + * loot. + * + * @param tool The tool or item used for breaking this block + * @return true if the tool is preferred for breaking this block. + */ + boolean isPreferredTool(@NotNull ItemStack tool); + /** * Checks if this block is passable. *