Cleanup Damage Handling Logic for CNPC+ and DBC Addon for better readability / context. Added Magic Data Support to Abilities

This commit is contained in:
Kam committed 2026-03-03 14:55:49 -05:00
1 parent b3dc23a23e
commit e4e2466a6e
2 files changed
+22

No files matched your search

@@ -1,6 +1,7 @@
package noppes.npcs.api.ability;
import noppes.npcs.api.INbt;
import noppes.npcs.api.handler.data.IMagicData;
/**
* Interface for NPC abilities.
@@ -343,4 +344,11 @@ public interface IAbility extends IAbilityAction {
* @return the label, or null if none set.
*/
String getToggleStateLabel(int state);
/**
* Get this ability's magic data. Defines magic types, damage splits,
* and flat magic damage for this ability. Inherited by spawned energy entities.
* @return the ability's magic data
*/
IMagicData getMagicData();
}
@@ -2,6 +2,7 @@ package noppes.npcs.api.entity;
import net.minecraft.entity.Entity;
import noppes.npcs.api.INbt;
import noppes.npcs.api.handler.data.IMagicData;
/**
* Base interface for all energy ability entities (Projectiles, Barriers).
@@ -110,4 +111,17 @@ public interface IEnergyAbility<T extends Entity> extends IEntity<T> {
* @param data Custom damage data as INbt. Pass null to clear.
*/
void setDamageData(INbt data);
/**
* Get this entity's magic data. Defines magic types for outgoing damage splits
* or barrier defense interactions. Inherited from the source ability on spawn.
* @return the entity's magic data
*/
IMagicData getMagicData();
/**
* Set magic data on this energy entity. Overrides any inherited ability magic.
* @param data Magic data to set.
*/
void setMagicData(IMagicData data);
}