Paper/Remapped-Spigot-Server-Patches/0687-Add-Block-isValidTool.patch
2021-06-11 13:56:17 +02:00

21 lines
794 B
Diff

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 376b0497c28a35d7ea615397c87b2558b95c596a..def19e23996b85e1e540cd5edc6821ae0ae37f91 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -803,5 +803,9 @@ public class CraftBlock implements Block {
}
return speed;
}
+
+ public boolean isValidTool(ItemStack itemStack) {
+ return getDrops(itemStack).size() != 0;
+ }
// Paper end
}