feat(invcleaner): add BestKnockback sort slot#8449
Open
m1trenv0 wants to merge 2 commits into
Open
Conversation
Adds a "BestKnockback" choice to InventoryCleaner's slot sorting. Any item carrying a Knockback enchantment (a stick, a sword, etc.) can now be kept and sorted into a dedicated slot, instead of being thrown away as junk - useful for knocking players into the void. - New ItemType.KNOCKBACK with a LOW allocation priority and no WEAPON_LIKE function, so a real weapon is still chosen as the main weapon first while a separate, lesser Knockback item is kept in its own slot. Example: a sword with Knockback IV fills the weapon slot, a Knockback III stick is kept in the BestKnockback slot, and any worse Knockback item is discarded. - New KnockbackItemFacet ranks candidates by Knockback level (then durability, enchantability, hotbar preference). Only the single best is kept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4dd4335 to
a67d08a
Compare
The BestKnockback slot kept any Knockback item, so a Knockback II fishing rod was kept even though the main weapon (a sword) already had Knockback II, making the spare item pointless. Now a dedicated knockback item is only treated as useful when its Knockback level is strictly higher than the highest Knockback among real weapons (swords, spears, maces, axes) in the inventory. A spare item with equal or lower Knockback than the main weapon is redundant and gets thrown out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds a BestKnockback option to InventoryCleaner's slot sorting list.
Any item carrying a Knockback enchantment (a stick, a sword, an axe…) can now be kept and sorted into a dedicated hotbar slot instead of being thrown away as junk — handy for knocking players into the void on maps like SkyWars.
How
ItemType.KNOCKBACK:NORMAL) — below the existing weapon types (SWORD/WEAPON/SPEAR/MACE), so a real weapon is still allocated as the main weapon first.WEAPON_LIKEfunction — so it is not deduplicated against the chosen weapon; a separate, lesser Knockback item is kept in its own slot rather than discarded.oneIsSufficient = true— only the single best Knockback item is kept; worse ones are thrown.KnockbackItemFacetranks candidates by Knockback level (then durability, enchantability, hotbar preference).ItemSortChoice.BEST_KNOCKBACKexposes it in the UI;getItemFacetsattaches the facet to any item with a Knockback enchantment.Example
Player has a sword with Knockback IV and a stick with Knockback III:
🤖 Generated with Claude Code