mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 17:39:39 +00:00
Scripting Ability Handling Improvement and Copy Data
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user