From e3ec51968c21144f69237c8123f09a2ff41c7002 Mon Sep 17 00:00:00 2001 From: booky10 <53302036+booky10@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:42:44 +0200 Subject: [PATCH] Fix nullability on Block#breakNaturally (#6651) --- .../api/Add-effect-to-block-break-naturally.patch | 12 ++++++++++-- .../server/Add-effect-to-block-break-naturally.patch | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/patches/api/Add-effect-to-block-break-naturally.patch b/patches/api/Add-effect-to-block-break-naturally.patch index 9af2e514d7..5017055439 100644 --- a/patches/api/Add-effect-to-block-break-naturally.patch +++ b/patches/api/Add-effect-to-block-break-naturally.patch @@ -14,8 +14,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + /** -+ * Breaks the block and spawns items as if a player had digged it with a -+ * specific tool ++ * Breaks the block and spawns item drops as if a player had broken it ++ * ++ * @param triggerEffect Play the block break particle effect and sound ++ * @return true if the block was destroyed ++ */ ++ boolean breakNaturally(boolean triggerEffect); ++ ++ /** ++ * Breaks the block and spawns item drops as if a player had broken it ++ * with a specific tool + * + * @param tool The tool or item in hand used for digging + * @param triggerEffect Play the block break particle effect and sound diff --git a/patches/server/Add-effect-to-block-break-naturally.patch b/patches/server/Add-effect-to-block-break-naturally.patch index 59e3609911..1d04323a02 100644 --- a/patches/server/Add-effect-to-block-break-naturally.patch +++ b/patches/server/Add-effect-to-block-break-naturally.patch @@ -17,6 +17,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override ++ public boolean breakNaturally(boolean triggerEffect) { ++ return breakNaturally(null, triggerEffect); ++ } ++ ++ @Override + public boolean breakNaturally(ItemStack item, boolean triggerEffect) { + // Paper end // Order matters here, need to drop before setting to air so skulls can get their data