mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
21 lines
859 B
Diff
21 lines
859 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 4239fa3d992722bd1d9184bb5c33ce5c14010052..5a6cc60d345dc146a2ce9bbd177b67a17bf5312b 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
@@ -692,5 +692,9 @@ public class CraftBlock implements Block {
|
|
public String translationKey() {
|
|
return this.getNMS().getBlock().getDescriptionId();
|
|
}
|
|
+
|
|
+ public boolean isValidTool(ItemStack itemStack) {
|
|
+ return getDrops(itemStack).size() != 0;
|
|
+ }
|
|
// Paper end
|
|
}
|