Scripting Ability Handling Improvement and Copy Data

This commit is contained in:
Kam committed 2026-02-24 21:23:40 -05:00
1 parent 50fd3c1856
commit 90735e6866
14 files changed
+71 -30

No files matched your search

@@ -18,6 +18,7 @@ import noppes.npcs.scripted.NpcAPI;
public class AbilityEvent extends NpcEvent implements IAbilityEvent {
protected final Ability ability;
protected final IEntityLivingBase target;
private transient IAbility abilityCopy;
public AbilityEvent(ICustomNpc npc, Ability ability, EntityLivingBase target) {
super(npc);
@@ -27,7 +28,10 @@ public class AbilityEvent extends NpcEvent implements IAbilityEvent {
@Override
public IAbility getAbility() {
return ability;
if (abilityCopy == null && ability != null) {
abilityCopy = ability.deepCopy();
}
return abilityCopy;
}
@Override