Search in sources :

Example 1 with GlowBlaze

use of net.glowstone.entity.monster.GlowBlaze in project Glowstone by GlowstoneMC.

the class GlowSnowball method collide.

/**
 * Process collide with a living entity.
 *
 * @param entity the eneity that the snowball collides with
 */
@Override
public void collide(LivingEntity entity) {
    ProjectileSource source = getShooter();
    // the entity receives fake damage.
    if (source instanceof Entity) {
        if (entity instanceof GlowBlaze) {
            entity.damage(3, (Entity) source, EntityDamageEvent.DamageCause.PROJECTILE);
        } else {
            entity.damage(0, (Entity) source, EntityDamageEvent.DamageCause.PROJECTILE);
        }
    } else {
        entity.damage(0, EntityDamageEvent.DamageCause.PROJECTILE);
    }
    collide(location.getBlock());
}
Also used : Entity(org.bukkit.entity.Entity) LivingEntity(org.bukkit.entity.LivingEntity) GlowBlaze(net.glowstone.entity.monster.GlowBlaze) ProjectileSource(org.bukkit.projectiles.ProjectileSource)

Aggregations

GlowBlaze (net.glowstone.entity.monster.GlowBlaze)1 Entity (org.bukkit.entity.Entity)1 LivingEntity (org.bukkit.entity.LivingEntity)1 ProjectileSource (org.bukkit.projectiles.ProjectileSource)1