Commits

Flo0 authored and md_5 committed 2b8fb83fd8d
#601: Add Block#isPreferredTool
No tags

src/main/java/org/bukkit/block/Block.java

Modified
423 423 * Returns a list of items which would drop by the entity destroying this
424 424 * block with a specific tool
425 425 *
426 426 * @param tool The tool or item in hand used for digging
427 427 * @param entity the entity destroying the block
428 428 * @return a list of dropped items for this type of block
429 429 */
430 430 @NotNull
431 431 Collection<ItemStack> getDrops(@NotNull ItemStack tool, @Nullable Entity entity);
432 432
433 + /**
434 + * Returns if the given item is a preferred choice to break this Block.
435 + *
436 + * In some cases this determines if a block will drop anything or extra
437 + * loot.
438 + *
439 + * @param tool The tool or item used for breaking this block
440 + * @return true if the tool is preferred for breaking this block.
441 + */
442 + boolean isPreferredTool(@NotNull ItemStack tool);
443 +
433 444 /**
434 445 * Checks if this block is passable.
435 446 * <p>
436 447 * A block is passable if it has no colliding parts that would prevent
437 448 * players from moving through it.
438 449 * <p>
439 450 * Examples: Tall grass, flowers, signs, etc. are passable, but open doors,
440 451 * fence gates, trap doors, etc. are not because they still have parts that
441 452 * can be collided with.
442 453 *

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut