use of org.bukkit.event.entity.ExplosionPrimeEvent in project Glowstone by GlowstoneMC.
the class GlowTNTPrimed method explode.
private void explode() {
ExplosionPrimeEvent event = EventFactory.callEvent(new ExplosionPrimeEvent(this));
if (!event.isCancelled()) {
Location location = getLocation();
double x = location.getX() + 0.5, y = location.getY() + 0.5, z = location.getZ() + 0.5;
world.createExplosion(this, x, y, z, event.getRadius(), event.getFire(), true);
}
remove();
}
use of org.bukkit.event.entity.ExplosionPrimeEvent in project Glowstone by GlowstoneMC.
the class GlowTntPrimed method explode.
private void explode() {
ExplosionPrimeEvent event = EventFactory.getInstance().callEvent(new ExplosionPrimeEvent(this));
if (!event.isCancelled()) {
Location location = getLocation();
world.createExplosion(this, location.getX(), location.getY() + 0.06125, location.getZ(), event.getRadius(), event.getFire(), true);
}
remove();
}
use of org.bukkit.event.entity.ExplosionPrimeEvent in project Glowstone by GlowstoneMC.
the class GlowEnderCrystal method damage.
@Override
public void damage(double amount, Entity source, @NotNull DamageCause cause) {
if (source instanceof EnderDragon) {
return;
}
if (cause != DamageCause.ENTITY_EXPLOSION) {
ExplosionPrimeEvent event = EventFactory.getInstance().callEvent(new ExplosionPrimeEvent(this, Explosion.POWER_ENDER_CRYSTAL, true));
if (!event.isCancelled()) {
Location location = getLocation();
double x = location.getX();
double y = location.getY();
double z = location.getZ();
world.createExplosion(this, x, y, z, event.getRadius(), event.getFire(), true);
}
}
remove();
}
Aggregations