mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 07:02:18 -07:00
Deprecate BlockData#getDestroySpeed for removal
The method sadly is not usable in 1.21 without a player as all of an enchantments attribtue modifiers rely on a base value supplied by a player. The method could only offer a rough estimate based on some default values, however a better method for this should be added down the line rather than trying to force such logic into the existing one.
This commit is contained in:
@@ -58,7 +58,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param itemStack {@link ItemStack} used to mine this Block
|
||||
+ * @return the speed that this Block will be mined by the given {@link ItemStack}
|
||||
+ * @deprecated the destroy speed of a block was never purely tied to an item stack. Since 1.21 enchantments
|
||||
+ * also use complex effects that require a consuming player to compute their effects, including mining efficiency.
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true, since = "1.21")
|
||||
+ default float getDestroySpeed(final @NotNull ItemStack itemStack) {
|
||||
+ return this.getDestroySpeed(itemStack, false);
|
||||
+ }
|
||||
@@ -71,7 +74,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @param itemStack {@link ItemStack} used to mine this Block
|
||||
+ * @param considerEnchants true to look at enchants on the itemstack
|
||||
+ * @return the speed that this Block will be mined by the given {@link ItemStack}
|
||||
+ * @deprecated the destroy speed of a block was never purely tied to an item stack. Since 1.21 enchantments
|
||||
+ * also use complex effects that require a consuming player to compute their effects, including mining efficiency.
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true, since = "1.21")
|
||||
+ float getDestroySpeed(@NotNull ItemStack itemStack, boolean considerEnchants);
|
||||
+ // Paper end - destroy speed API
|
||||
}
|
||||
|
Reference in New Issue
Block a user