Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Make Swing Speed Constant by Adding Ignore Haste Toggle
Problem
The swing animation speed was not constant throughout different islands or when using different gear sets. This was because Minecraft's
hasteandmining fatiguepotion effects directly affect theLivingEntity#getCurrentSwingDuration()return value, causing the visual swing animation to vary even when the player had the same swing speed multiplier configured.Example:
This meant a player with the same swing speed multiplier would see different animation speeds depending on their active potion effects.
Solution
Added an
IGNORE_HASTEtoggle feature that:IGNORE_HASTE(default:false) persisted toconfig/swing.json/swing) to toggle "Ignore Haste: ON / OFF" with live updatesChanges
ItemTweaksConfig.java
DEFAULT_IGNORE_HASTE = falseconstantIGNORE_HASTEstatic field with documentationresetToVanilla(),load(),save(), andFileDatato handle the new fieldLivingEntitySwingMixin.java
VANILLA_BASE_DURATION = 6constantIGNORE_HASTEis true, always start from 6 ticks instead of the haste-modified valueSwingSettingsScreen.java
hasteToggleBtnbutton between swing speed and held item scale rowstoggleIgnoreHaste()andhasteToggleLabel()helper methodsTesting
✅ Gradle build passes successfully
✅ All three files compile without errors
✅ Config persistence working (JSON serialization/deserialization)
Closes #2