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(); }
@Override public void damage(double amount, Entity source, 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(); }