Skip to content

VanillaOnly Stat support & Fixes on resistance and absorption mechanics#339

Open
MaksyKun wants to merge 21 commits into
devfrom
divinity-custom-usecase-maksykun
Open

VanillaOnly Stat support & Fixes on resistance and absorption mechanics#339
MaksyKun wants to merge 21 commits into
devfrom
divinity-custom-usecase-maksykun

Conversation

@MaksyKun

@MaksyKun MaksyKun commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds some old fixes (00d677f#diff-9f550a722a805c537319b09760b23aafc9e8f5de24308c96d4438a3baf610c13) for pretty vanilla related servers:
engine.yml

[...]
attributes:
  hide-flags: true # Rather custom items will automatically be hidden on all flags. Default behavior is true
[...]
legacy:
  vanilla-entity-stats: false # Makes sure that stats dont affect entities, default is keep the current behavior
  vanilla-item-stats: false # Makes sure that stats dont affect item, default is keep the current behavior

Further things:

  • Fixes resistance and absorption behaviour
    • Resistance was completly ignored
    • Absorption was like... drained from the user within a second (even 20 hearts)

@MaksyKun
MaksyKun requested a review from Travja July 24, 2026 18:23
@MaksyKun MaksyKun self-assigned this Jul 24, 2026
claude added 2 commits July 25, 2026 01:19
Covers the changes in PR #339: unit tests exercising the
VanillaWrapperListener damage-modifier math directly (resistance no
longer zeroed out, absorption capped to the victim's available amount
and applied only once), plus tests confirming the new
LEGACY_VANILLA_ENTITY_STATS and LEGACY_VANILLA_ITEM_STATS flags
correctly no-op the entity/item stat pipelines when enabled.
This Bukkit version's EntityDamageByEntityEvent constructor expects
com.google.common.base.Function rather than java.util.function.Function.
@Travja

Travja commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Naming nit: "legacy" is misleading here

This was never legacy behavior — it's new, opt-in "pure vanilla" mode. LEGACY_COMBAT (an older combat formula kept for back-compat) is a legit use of "legacy"; borrowing that prefix here implies restoring something old, when it's really "stop Divinity from touching vanilla stats at all."

Suggest renaming to something like VANILLA_ONLY_ENTITY_STATS / VANILLA_ONLY_ITEM_STATS (or VANILLA_ENTITY_STATS/VANILLA_ITEM_STATS), and the config path legacy.vanilla-entity-statsvanilla-only.entity-stats (drop the legacy parent key):

  • EngineCfg.java:117-118 — field declarations
  • EngineCfg.java:433,436 — config paths ("legacy.vanilla-entity-stats", "legacy.vanilla-item-stats")
  • The if (EngineCfg.LEGACY_VANILLA_ENTITY_STATS) return; / LEGACY_VANILLA_ITEM_STATS guard checks in EntityManager.java, DynamicStatListener.java, EntityStats.java, ItemStats.java

Not blocking — just flagging for clarity. Happy to do the rename if you'd rather not churn it further.


Also: opened #340 with test coverage for the resistance/absorption fix and the new legacy-vanilla flags, targeting this branch — take a look when you get a chance.

@Travja Travja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line-by-line naming suggestions for the "legacy" prefix (see general PR comment for the full rationale). Proposing VANILLA_ONLY_* in place of LEGACY_VANILLA_*, and vanilla-only.* in place of legacy.* for the config path. Non-blocking.

Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/config/EngineCfg.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/manager/EntityManager.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/stats/EntityStats.java Outdated
Comment thread src/main/java/studio/magemonkey/divinity/stats/items/ItemStats.java Outdated

@Travja Travja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(test comment retracted — please ignore)

MaksyKun and others added 13 commits July 25, 2026 08:44
Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
….java

Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
…ct/DynamicStatListener.java

Co-authored-by: Trav <the.only.t.craft@gmail.com>
….java

Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
Co-authored-by: Trav <the.only.t.craft@gmail.com>
…on-fpuec4

Add legacy vanilla stats mode and fix damage modifier handling
@MaksyKun MaksyKun changed the title Divinity custom usecase maksykun VanillaOnly Stat support & Fixes on resistance and absorption mechanics Jul 25, 2026
@MaksyKun

Copy link
Copy Markdown
Contributor Author

Thanks for pointing that out. Vanilla-only sounds even better, haha
Also included your test case PR 👍

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.

3 participants