feat(AutoArmor): add RawDefense ranking mode for legacy (1.8) PvP#8516
Open
m1trenv0 wants to merge 1 commit into
Open
feat(AutoArmor): add RawDefense ranking mode for legacy (1.8) PvP#8516m1trenv0 wants to merge 1 commit into
m1trenv0 wants to merge 1 commit into
Conversation
The default armor ranking weighs every damage-reduction enchantment (including Fire/Blast Protection) into a single modern, toughness-aware damage value. On legacy (1.8) servers such as Hypixel SkyWars/BedWars this is misleading: it can rank, e.g., iron with high Fire Protection above plain diamond, because those enchantments are treated as if they reduced all incoming damage. Add a Mode selector to AutoArmor: - Smart (default): the original behaviour, unchanged. - RawDefense: ranks by total damage reduction under the legacy 1.8 model (1 armor point = flat 4%, capped 80%, no toughness). Only Protection and -optionally- Projectile Protection influence the ranking; niche enchantments only break exact ties so they can never beat real armor. RawDefense exposes ConsiderProjectileProtection (default on): when on, Projectile Protection is a deciding argument; when off it only matters when everything else is equal. The comparator mode and flag are threaded through ArmorEvaluation with SMART as the default, so InvCleaner and AutoArmorSaveArmor behaviour is unchanged.
b880a83 to
09d3673
Compare
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.
Summary
AutoArmor's default ranking weighs every damage-reduction enchantment — including Fire Protection and Blast Protection — into a single, modern (toughness-aware) damage value. On legacy 1.8 servers (e.g. Hypixel SkyWars/BedWars) this is misleading: those enchantments are treated as if they reduced all incoming damage, so the module can rank, for example, iron with high Fire Protection above plain diamond, even though the diamond is objectively better there.
This PR adds a Mode selector to AutoArmor instead of changing the existing behaviour, so nobody's current setup regresses.
Modes
RawDefense option
Compatibility
The new
modeandconsiderProjectileProtectionare threaded throughArmorEvaluationwithSMARTas the default, so InvCleaner and AutoArmorSaveArmor keep their exact current behaviour — only AutoArmor reads the new selector.Testing
./gradlew compileKotlin— passes../gradlew detekt— passes.