From 3817951b8674fe9d292379a9821dffd80dd1886a Mon Sep 17 00:00:00 2001 From: cech12 Date: Mon, 8 Jul 2024 18:13:58 +0200 Subject: [PATCH] fix the speed calculation of all mining hats #62 --- CHANGELOG.md | 4 ++++ .../java/de/cech12/usefulhats/item/AbstractMiningHatItem.java | 2 +- gradle.properties | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 905b803..865ab7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.6-5.2.0.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.6-5.2.0.0] - 2024-05-28 ### Changed - updated to Minecraft 1.20.6 (Fabric 0.99.0+1.20.6, Neoforge 20.6.83-beta, Forge 50.0.31) diff --git a/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java b/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java index 8bc582e..cb0e1ee 100644 --- a/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java +++ b/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java @@ -27,7 +27,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; } diff --git a/gradle.properties b/gradle.properties index e4a0de9..09fa754 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ # Project group=de.cech12.usefulhats -mod_version=5.2.0.0 +mod_version=5.2.0.1 mod_id=usefulhats mod_name=Useful Hats mod_author=Cech12