Fix dynamic tools not using their mining speed on modded blocks with mining level 0. (#1030)

This commit is contained in:
shartte 2020-08-21 18:20:03 +02:00 committed by GitHub
parent e81ec80bf4
commit ccce563e15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-tool-attribute-api-v1" archivesBaseName = "fabric-tool-attribute-api-v1"
version = getSubprojectVersion(project, "1.2.1") version = getSubprojectVersion(project, "1.2.2")
dependencies { dependencies {
compile project(path: ':fabric-api-base', configuration: 'dev') compile project(path: ':fabric-api-base', configuration: 'dev')

View file

@ -55,7 +55,7 @@ public class ModdedToolsModdedBlocksToolHandler implements ToolManagerImpl.ToolH
if (stack.getItem() instanceof DynamicAttributeTool) { if (stack.getItem() instanceof DynamicAttributeTool) {
ToolManagerImpl.Entry entry = ToolManagerImpl.entryNullable(state.getBlock()); 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); float multiplier = ((DynamicAttributeTool) stack.getItem()).getMiningSpeedMultiplier(tag, state, stack, user);
if (multiplier != 1.0F) return TypedActionResult.success(multiplier); if (multiplier != 1.0F) return TypedActionResult.success(multiplier);
} }