mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 19:52:06 -07:00
Don't throw NPE for unplaced blockstate on #getDrops (#10366)
This commit is contained in:
@@ -19,9 +19,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * Returns an immutable list of items which would drop by destroying this block state.
|
||||
+ *
|
||||
+ * @return an immutable list of dropped items for the block state
|
||||
+ * @throws IllegalStateException if this block state is not placed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops();
|
||||
+ default java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops() {
|
||||
+ return this.getDrops(null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns an immutable list of items which would drop by destroying this block state
|
||||
@@ -29,9 +32,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param tool The tool or item in hand used for digging
|
||||
+ * @return an immutable list of dropped items for the block state
|
||||
+ * @throws IllegalStateException if this block state is not placed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@Nullable org.bukkit.inventory.ItemStack tool);
|
||||
+ default java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@Nullable org.bukkit.inventory.ItemStack tool) {
|
||||
+ return this.getDrops(tool, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns an immutable list of items which would drop by the entity destroying this
|
||||
@@ -40,6 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @param tool The tool or item in hand used for digging
|
||||
+ * @param entity the entity destroying the block
|
||||
+ * @return an immutable list of dropped items for the block state
|
||||
+ * @throws IllegalStateException if this block state is not placed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@Nullable org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity);
|
||||
|
Reference in New Issue
Block a user