aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0613-Add-Block-isValidTool.patch
blob: 8442851de206d04ed15a9cf44e71cc437a2c9d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Mon, 6 Jul 2020 12:44:31 -0700
Subject: [PATCH] Add Block#isValidTool


diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 0be0ddcb8ea184683c1d0c619a932f3b03064941..55f830598e67943674aa54ddfefc02bb3a3a3dcc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -676,5 +676,9 @@ public class CraftBlock implements Block {
         }
         return speed;
     }
+
+    public boolean isValidTool(ItemStack itemStack) {
+        return getDrops(itemStack).size() != 0;
+    }
     // Paper end
 }