PaperMC/patches/server/0560-Add-Block-isValidTool.patch
Jake Potrebic 0cdce89d59
Fix a bunch of stuff with player spawn locations (#9887)
If a playerdata doesn't contain a valid, loaded world, reset
to the main world spawn point
2023-11-04 14:11:55 -07:00

20 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 1d637f5be518a054767154296fb7905bdbc175ec..a33e7114ac902ae66a31e0298e7c13af2d11b07c 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
}