Fix type mismatch in AutoArmor, aura leak in AutoEat, stale packets in Blink#6443
Open
Aevumly wants to merge 5 commits into
Open
Fix type mismatch in AutoArmor, aura leak in AutoEat, stale packets in Blink#6443Aevumly wants to merge 5 commits into
Aevumly wants to merge 5 commits into
Conversation
Author
|
Heads up — I accidentally pushed directly to my fork’s master instead of a separate branch. The changes are the same, will use a dedicated branch next time. |
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.
Type of change
Description
AutoArmor — Curse of Binding check never fires + avoided enchantment penalty broken
enchantmentsis keyed byHolder<Enchantment>, but two places were passingResourceKey<Enchantment>directly.containsKey(Enchantments.BINDING_CURSE)always returns false since the types never compare equal, meaning AutoArmor would attempt to swap off Binding Curse armor. Same issue indecreaseScoreByAvoidedEnchantments—enchantments.getInt(ResourceKey)always returns 0, so the score penalty for avoided enchantments was effectively dead code. Fixed both by usingHolder.is()andUtils.getEnchantmentLevel, consistent with how the rest of the class handles enchantment lookups.AutoEat — auras get permanently disabled when slot swap fails
When
searchInventoryis enabled and food is in the main inventory,changeSlotcan return false if the hotbar is full. In that caseeat()returns early without settingeating = true, butstartEatingstill continues and pauses auras and baritone. Sinceeatingstays false,stopEatingis never triggered — including fromonDeactivate, which guards onif (eating). Added an early return instartEatingright aftereat()to avoid pausing auras if the eat didn't actually start.Blink — stale packets sent to the next server after disconnect
onLeaveGamecalledonDeactivate, which exits early throughUtils.canUpdate()whenmc.playeris null. So thepacketslist never gets cleared on disconnect. When the player joins a new server, those old movement packets are still queued and get flushed when Blink is disabled. Replaced theonDeactivatecall withdumpPackets(false)directly since it skips the send path and is safe to call with a null player.Related issues
N/A
Checklist: