Files
OldSliceMC/patches/api/0004-Add-provided-Material-to-getDrops.patch
2023-04-10 08:53:32 -05:00

32 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cryptite <cryptite@gmail.com>
Date: Mon, 10 Apr 2023 07:31:55 -0500
Subject: [PATCH] Add provided Material to getDrops
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 384e5700b6899850d91a34e1d13d1ca0678cfaaa..9c1aef68b1b6f4fddfa171f7189dda5619e758d6 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -666,6 +666,20 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
@NotNull
Collection<ItemStack> getDrops(@NotNull ItemStack tool, @Nullable Entity entity);
+ // Slice start
+ /**
+ * Returns a list of items which would drop by the entity destroying this
+ * block as though it were a given Material with a specific tool
+ *
+ * @param blockType The block type to use as the source loot
+ * @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<ItemStack> getDrops(@NotNull Material blockType, @NotNull ItemStack tool, @Nullable Entity entity);
+ // Slice end
+
/**
* Returns if the given item is a preferred choice to break this Block.
*