mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 04:09:57 +00:00
Refactor ability handling: replace damage handler with ability extenders for improved lifecycle management and damage routing
This commit is contained in:
1 parent
f8c75dd79b
commit
0f774a68fc
7 files changed
+184
-53
No files matched your search
@@ -329,13 +329,10 @@ public abstract class Ability implements IAbility {
|
||||
|
||||
// Apply damage
|
||||
if (damage > 0) {
|
||||
// Check for external damage handler first (e.g., DBC Addon)
|
||||
IAbilityDamageHandler handler = AbilityController.Instance.getDamageHandler();
|
||||
boolean handled = false;
|
||||
if (handler != null) {
|
||||
handled = handler.handleDamage(this, caster, hitEntity, damage, knockback, knockbackUp,
|
||||
knockbackDirX, knockbackDirZ);
|
||||
}
|
||||
// Check for ability extenders (e.g., DBC Addon damage routing)
|
||||
boolean handled = AbilityController.Instance.fireOnAbilityDamage(
|
||||
this, caster, hitEntity, damage, knockback, knockbackUp,
|
||||
knockbackDirX, knockbackDirZ);
|
||||
if (!handled) {
|
||||
// Default damage path
|
||||
if (caster instanceof EntityNPCInterface) {
|
||||
|
||||
Reference in new issue
Block a user