Add EntityZapEvent

This commit is contained in:
AlphaBlend
2016-10-16 23:19:30 -07:00
parent 8141041554
commit 472983f423
4 changed files with 66 additions and 18 deletions

View File

@@ -1215,6 +1215,14 @@ public class CraftEventFactory {
return !event.isCancelled();
}
// Paper start
public static com.destroystokyo.paper.event.entity.EntityZapEvent callEntityZapEvent(Entity entity, Entity lightning, Entity changedEntity) {
com.destroystokyo.paper.event.entity.EntityZapEvent event = new com.destroystokyo.paper.event.entity.EntityZapEvent(entity.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), changedEntity.getBukkitEntity());
entity.getBukkitEntity().getServer().getPluginManager().callEvent(event);
return event;
}
// Paper end
public static boolean callEntityChangeBlockEvent(Entity entity, BlockPos position, net.minecraft.world.level.block.state.BlockState newBlock) {
return CraftEventFactory.callEntityChangeBlockEvent(entity, position, newBlock, false);
}