Add legacy vanilla stats mode and fix damage modifier handling#340
Merged
MaksyKun merged 2 commits intoJul 25, 2026
Merged
Conversation
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.
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
This PR introduces legacy vanilla stats configuration options and fixes critical issues with damage modifier calculations in the combat system. It also improves item attribute flag handling and adds comprehensive test coverage for the new functionality.
Key Changes
Legacy Vanilla Stats Mode
LEGACY_VANILLA_ENTITY_STATSandLEGACY_VANILLA_ITEM_STATSconfiguration flags to allow servers to opt-out of custom stat systemsengine.ymlDamage Modifier Fixes
Item Attribute Flag Handling
ATTRIBUTES_HIDE_FLAGSconfiguration option to control whether item flags are automatically hiddenItemUpdaterListenerto respect the new configuration and maintain item integrityVanilla Item Attributes
updateVanillaItemAttributes()method toEntityManagerto apply vanilla item attribute updates on equipment changesTesting
VanillaWrapperListenerTesttest cases for resistance and absorption modifier handlingEntityManagerTestto verify legacy vanilla entity stats behaviorItemStatsTestto verify legacy vanilla item stats behaviorImplementation Details
https://claude.ai/code/session_01Kxixg1aALhv5G8V1FEw8Sb