mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 09:37:29 +00:00
Fix IProjectile Events
Thank you @somehussar
This commit is contained in:
1 parent
782f21f1fe
commit
24d12e25a9
6 files changed
+57
-6
No files matched your search
@@ -29,6 +29,7 @@ import noppes.npcs.DataStats;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IProjectile;
|
||||
import noppes.npcs.constants.EnumParticleType;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
@@ -449,7 +450,8 @@ public class EntityProjectile extends EntityThrowable {
|
||||
if (!this.worldObj.isRemote) {
|
||||
ProjectileEvent.ImpactEvent event;
|
||||
if (movingobjectposition.entityHit != null) {
|
||||
event = new ProjectileEvent.ImpactEvent((IProjectile) NpcAPI.Instance().getIEntity(this), 0, movingobjectposition.entityHit);
|
||||
IEntity target = NpcAPI.Instance().getIEntity(movingobjectposition.entityHit);
|
||||
event = new ProjectileEvent.ImpactEvent((IProjectile) NpcAPI.Instance().getIEntity(this), 0, target);
|
||||
} else {
|
||||
IPos pos = NpcAPI.Instance().getIPos(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
|
||||
IWorld world = NpcAPI.Instance().getIWorld(this.worldObj);
|
||||
|
||||
Reference in new issue
Block a user