Skip to content

Commit

Permalink
Make mattock secondary multiplier simplier
Browse files Browse the repository at this point in the history
Means you can set it with the stats command
  • Loading branch information
KnightMiner committed Nov 15, 2021
1 parent d4652db commit 73b7072
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ToolStats {
/** Mining level for breaking blocks */
public static final TierToolStat HARVEST_LEVEL = register(new TierToolStat(name("harvest_level"), HarvestLevels.WOOD, HarvestLevels::getHarvestLevelName));
/** Multiplier for mining speed on non-dirt blocks for the mattock */
public static final FloatToolStat SECONDARY_MINING = register(new FloatToolStat(name("secondary_mining"), 0xFF78A0CD, 0, -2048f, 2048f));
public static final FloatToolStat SECONDARY_MINING = register(new FloatToolStat(name("secondary_mining"), 0xFF78A0CD, 1, 0, 10f));

/**
* Gets the tool stat for the given name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public float getDestroySpeed(ItemStack stack, BlockState blockState) {
// slower when a non-shovel block
float speed = tool.getStats().getFloat(ToolStats.MINING_SPEED);
if (!blockState.isToolEffective(ToolType.SHOVEL)) {
speed = Math.max(1f, (speed + tool.getStats().getFloat(ToolStats.SECONDARY_MINING)) * tool.getModifier(ToolStats.SECONDARY_MINING));
speed = Math.max(1f, (speed * tool.getStats().getFloat(ToolStats.SECONDARY_MINING)));
}
return speed;
}
Expand Down

0 comments on commit 73b7072

Please sign in to comment.