#601: Add Block#isPreferredTool

By: Flo0 <unconfigured@null.spigotmc.org>
This commit is contained in:
Bukkit/Spigot 2021-04-21 17:31:45 +10:00
parent fbf66f5957
commit b0c8a52b02

View file

@ -430,6 +430,17 @@ public interface Block extends Metadatable {
@NotNull
Collection<ItemStack> 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.
* <p>