From ccce563e157451f19fc14b1479beabef43e48ca9 Mon Sep 17 00:00:00 2001 From: shartte Date: Fri, 21 Aug 2020 18:20:03 +0200 Subject: [PATCH] Fix dynamic tools not using their mining speed on modded blocks with mining level 0. (#1030) --- fabric-tool-attribute-api-v1/build.gradle | 2 +- .../attribute/handlers/ModdedToolsModdedBlocksToolHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabric-tool-attribute-api-v1/build.gradle b/fabric-tool-attribute-api-v1/build.gradle index 013c22938..e4e856039 100644 --- a/fabric-tool-attribute-api-v1/build.gradle +++ b/fabric-tool-attribute-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-tool-attribute-api-v1" -version = getSubprojectVersion(project, "1.2.1") +version = getSubprojectVersion(project, "1.2.2") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-tool-attribute-api-v1/src/main/java/net/fabricmc/fabric/impl/tool/attribute/handlers/ModdedToolsModdedBlocksToolHandler.java b/fabric-tool-attribute-api-v1/src/main/java/net/fabricmc/fabric/impl/tool/attribute/handlers/ModdedToolsModdedBlocksToolHandler.java index 2df377399..ff2d67f43 100644 --- a/fabric-tool-attribute-api-v1/src/main/java/net/fabricmc/fabric/impl/tool/attribute/handlers/ModdedToolsModdedBlocksToolHandler.java +++ b/fabric-tool-attribute-api-v1/src/main/java/net/fabricmc/fabric/impl/tool/attribute/handlers/ModdedToolsModdedBlocksToolHandler.java @@ -55,7 +55,7 @@ public class ModdedToolsModdedBlocksToolHandler implements ToolManagerImpl.ToolH if (stack.getItem() instanceof DynamicAttributeTool) { ToolManagerImpl.Entry entry = ToolManagerImpl.entryNullable(state.getBlock()); - if (entry != null && entry.getMiningLevel(tag) > 0) { + if (entry != null && entry.getMiningLevel(tag) >= 0) { float multiplier = ((DynamicAttributeTool) stack.getItem()).getMiningSpeedMultiplier(tag, state, stack, user); if (multiplier != 1.0F) return TypedActionResult.success(multiplier); }