use of org.bukkit.event.entity.EntityCombustByEntityEvent in project Arclight by IzzelAliz.
the class AbstractArrowEntityMixin method arclight$fireShot.
@Redirect(method = "onEntityHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setFire(I)V"))
private void arclight$fireShot(Entity entity, int seconds, EntityRayTraceResult result) {
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), ((EntityBridge) entity).bridge$getBukkitEntity(), seconds);
Bukkit.getPluginManager().callEvent(combustEvent);
if (!combustEvent.isCancelled()) {
((EntityBridge) entity).bridge$setOnFire(combustEvent.getDuration(), false);
}
}
use of org.bukkit.event.entity.EntityCombustByEntityEvent in project Arclight by IzzelAliz.
the class EntityMixin method arclight$onStruckByLightning$EntityCombustByEntityEvent0.
@Redirect(method = "onStruckByLightning", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;setFire(I)V"))
public void arclight$onStruckByLightning$EntityCombustByEntityEvent0(Entity entity, int seconds) {
final org.bukkit.entity.Entity thisBukkitEntity = this.getBukkitEntity();
final org.bukkit.entity.Entity stormBukkitEntity = ((EntityBridge) entity).bridge$getBukkitEntity();
final PluginManager pluginManager = Bukkit.getPluginManager();
// CraftBukkit start - Call a combust event when lightning strikes
EntityCombustByEntityEvent entityCombustEvent = new EntityCombustByEntityEvent(stormBukkitEntity, thisBukkitEntity, 8);
pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) {
this.setFire(entityCombustEvent.getDuration());
}
// CraftBukkit end
}
Aggregations