From 23efa7fb0c8384f778f4ba0a2bf4cb62fdcacf52 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 5 Apr 2020 16:51:54 +1000 Subject: [PATCH] SPIGOT-5641: Add Block.getDrops(ItemStack, Entity) By: md_5 --- paper-api/src/main/java/org/bukkit/block/Block.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/block/Block.java b/paper-api/src/main/java/org/bukkit/block/Block.java index ab6750c7a5..8a48572e92 100644 --- a/paper-api/src/main/java/org/bukkit/block/Block.java +++ b/paper-api/src/main/java/org/bukkit/block/Block.java @@ -8,6 +8,7 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.data.Bisected; import org.bukkit.block.data.BlockData; +import org.bukkit.entity.Entity; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.Metadatable; import org.bukkit.util.BoundingBox; @@ -408,6 +409,17 @@ public interface Block extends Metadatable { @NotNull Collection getDrops(@NotNull ItemStack tool); + /** + * Returns a list of items which would drop by the entity destroying this + * block with a specific tool + * + * @param tool The tool or item in hand used for digging + * @param entity the entity destroying the block + * @return a list of dropped items for this type of block + */ + @NotNull + Collection getDrops(@NotNull ItemStack tool, @Nullable Entity entity); + /** * Checks if this block is passable. *