Fix IProjectile Events

Thank you @somehussar
This commit is contained in:
Kam committed 2023-12-31 16:10:38 -05:00
1 parent 782f21f1fe
commit 24d12e25a9
6 files changed
+57 -6

No files matched your search

+16
View File
@@ -262,6 +262,14 @@ public class EventHooks {
script.run(EnumScriptType.PROJECTILE_TICK, event);
}
}
EntityLivingBase thrower = projectile.getThrower();
if(thrower != null){
if(thrower instanceof EntityNPCInterface){
((EntityNPCInterface) thrower).script.callScript(EnumScriptType.PROJECTILE_TICK, event);
}
}
NpcAPI.EVENT_BUS.post(event);
}
@@ -272,6 +280,14 @@ public class EventHooks {
script.run(EnumScriptType.PROJECTILE_IMPACT, event);
}
}
EntityLivingBase thrower = projectile.getThrower();
if(thrower != null){
if(thrower instanceof EntityNPCInterface){
((EntityNPCInterface) thrower).script.callScript(EnumScriptType.PROJECTILE_IMPACT, event);
}
}
NpcAPI.EVENT_BUS.post(event);
}