Fixes Console-Spam when using axes

This commit is contained in:
Christian Koop 2022-07-07 19:55:26 +02:00
parent fc5e102e0c
commit 7479ed36b7
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 2 additions and 2 deletions

View File

@ -324,7 +324,7 @@ public class TreeDefinitionManager extends Manager {
for (TreeDefinition treeDefinition : this.treeDefinitions) {
if (treeDefinition.isRequiredAxe() || isGlobalAxeRequired()) {
if (new NBTItem(tool).hasKey(requiredAxeKey))
if (tool != null && !tool.getType().isAir() && new NBTItem(tool).hasKey(requiredAxeKey))
return true;
}
}
@ -356,7 +356,7 @@ public class TreeDefinitionManager extends Manager {
// If the tree definition requires the custom axe, don't allow any other checks to pass.
if (treeDefinition.isRequiredAxe() || isGlobalAxeRequired()) {
return new NBTItem(tool).hasKey(requiredAxeKey);
return tool != null && !tool.getType().isAir() && new NBTItem(tool).hasKey(requiredAxeKey);
}
for (ItemStack requiredTool : treeDefinition.getRequiredTools())