Skip to content

feat(AutoArmor): add RawDefense ranking mode for legacy (1.8) PvP#8516

Open
m1trenv0 wants to merge 1 commit into
CCBlueX:nextgenfrom
m1trenv0:fix/autoarmor-rawdefense-mode
Open

feat(AutoArmor): add RawDefense ranking mode for legacy (1.8) PvP#8516
m1trenv0 wants to merge 1 commit into
CCBlueX:nextgenfrom
m1trenv0:fix/autoarmor-rawdefense-mode

Conversation

@m1trenv0

Copy link
Copy Markdown
Contributor

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

  • Smart (default) — the original behaviour, completely unchanged.
  • RawDefense — ranks by total damage reduction under the legacy 1.8 model:
    • 1 armor point = a flat 4% reduction, capped at 80%, no toughness, no damage-strength scaling.
    • Only Protection and (optionally) Projectile Protection influence the ranking.
    • Niche enchantments (Fire/Blast Protection, Thorns, Unbreaking, …) only break exact ties, so they can never out-rank real armor.

RawDefense option

  • ConsiderProjectileProtection (default on) — when enabled, Projectile Protection acts as a deciding argument (useful on archer-heavy servers); when disabled it only matters when everything else is equal. It is shown only while RawDefense is selected.

Compatibility

The new mode and considerProjectileProtection are threaded through ArmorEvaluation with SMART as the default, so InvCleaner and AutoArmorSaveArmor keep their exact current behaviour — only AutoArmor reads the new selector.

Testing

  • ./gradlew compileKotlin — passes.
  • ./gradlew detekt — passes.

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.
@m1trenv0 m1trenv0 force-pushed the fix/autoarmor-rawdefense-mode branch from b880a83 to 09d3673 Compare June 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant