Skip to content

Commit

Permalink
fix the speed calculation of all mining hats #62
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Jul 8, 2024
1 parent e4b6f09 commit 8c8fa21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.20.4-5.1.3.1] - 2024-07-08
### Fixed
- speed calculation for straw hat/chopping hat/mining helmet was wrong (all loaders) (thanks to Imperial-Warlord for the report) #62

## [1.20.4-5.1.3.0] - 2024-05-20
### Added
- added support for diving in modded fluids with Aquanaut Helmet (Neoforge, Forge)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import de.cech12.usefulhats.platform.Services;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.block.state.BlockState;

import java.util.function.Supplier;

Expand All @@ -26,7 +26,7 @@ protected double getEnchantmentDoubleValue(final ItemStack stack) {
@Override
public float onBreakSpeedEvent(Player player, BlockState blockState, float actualSpeed, ItemStack headSlotItemStack) {
if (this.isToolEffective(player.getMainHandItem(), blockState)) {
return (1.0F + (float) this.getEnchantmentDoubleValue(headSlotItemStack) * actualSpeed);
return (1.0F + (float) this.getEnchantmentDoubleValue(headSlotItemStack)) * actualSpeed;
}
return actualSpeed;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Project
group=de.cech12.usefulhats
mod_version=5.1.3.0
mod_version=5.1.3.1
mod_id=usefulhats
mod_name=Useful Hats
mod_author=Cech12
Expand Down

0 comments on commit 8c8fa21

Please sign in to comment.