mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 14:59:05 +00:00
Added target lost event. Added all new NPC events to the old 1.7.10 script system.
This commit is contained in:
1 parent
29935a1c6d
commit
fe780d69ee
9 files changed
+39
-8
No files matched your search
@@ -420,11 +420,13 @@ public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
|
||||
|
||||
@Cancelable
|
||||
public static class TargetLostEvent extends NpcEvent implements INpcEvent.TargetLostEvent {
|
||||
public final IEntityLivingBase entity;
|
||||
public final IEntityLivingBase oldTarget;
|
||||
public final IEntityLivingBase newTarget;
|
||||
|
||||
public TargetLostEvent(ICustomNpc npc, EntityLivingBase entity) {
|
||||
public TargetLostEvent(ICustomNpc npc, EntityLivingBase oldTarget, EntityLivingBase newTarget) {
|
||||
super(npc);
|
||||
this.entity = (IEntityLivingBase) NpcAPI.Instance().getIEntity(entity);
|
||||
this.oldTarget = (IEntityLivingBase) NpcAPI.Instance().getIEntity(oldTarget);
|
||||
this.newTarget = (IEntityLivingBase) NpcAPI.Instance().getIEntity(newTarget);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
@@ -432,7 +434,11 @@ public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
|
||||
}
|
||||
|
||||
public IEntityLivingBase getTarget() {
|
||||
return entity;
|
||||
return oldTarget;
|
||||
}
|
||||
|
||||
public IEntityLivingBase getNewTarget() {
|
||||
return newTarget;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user