From 8c8fa2154b012637863d7ddcb30c70cdd53d9284 Mon Sep 17 00:00:00 2001 From: cech12 Date: Mon, 8 Jul 2024 18:12:18 +0200 Subject: [PATCH] fix the speed calculation of all mining hats #62 --- CHANGELOG.md | 4 ++++ .../de/cech12/usefulhats/item/AbstractMiningHatItem.java | 6 +++--- gradle.properties | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50574de..cce8c4f 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.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) 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 beb4230..ec712f5 100644 --- a/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java +++ b/common/src/main/java/de/cech12/usefulhats/item/AbstractMiningHatItem.java @@ -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; @@ -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; } diff --git a/gradle.properties b/gradle.properties index 35d80a6..fa3c690 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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