mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-23 08:08:02 -05:00
Fix dynamic tools not using their mining speed on modded blocks with mining level 0. (#1030)
This commit is contained in:
parent
e81ec80bf4
commit
ccce563e15
2 changed files with 2 additions and 2 deletions
|
@ -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')
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue