Java Code Examples for cn.nukkit.event.entity.EntityDamageEvent.DamageCause#VOID

The following examples show how to use cn.nukkit.event.entity.EntityDamageEvent.DamageCause#VOID . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityXPOrb.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION)
            && super.attack(source);
}
 
Example 2
Source File: EnchantmentProtectionAll.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public float getDamageProtection(EntityDamageEvent e) {
    DamageCause cause = e.getCause();

    if (level <= 0 || cause == DamageCause.VOID || cause == DamageCause.CUSTOM || cause == DamageCause.MAGIC) {
        return 0;
    }

    return (float) (getLevel() * getTypeModifier());
}
 
Example 3
Source File: EntityXPOrb.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION)
            && super.attack(source);
}
 
Example 4
Source File: EntityItem.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION)
            && super.attack(source);
}
 
Example 5
Source File: EnchantmentProtectionAll.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public float getProtectionFactor(EntityDamageEvent e) {
    DamageCause cause = e.getCause();

    if (level <= 0 || cause == DamageCause.VOID || cause == DamageCause.CUSTOM || cause == DamageCause.MAGIC) {
        return 0;
    }

    return (float) (getLevel() * getTypeModifier());
}
 
Example 6
Source File: EntityFirework.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION)
            && super.attack(source);
}
 
Example 7
Source File: EntityXPOrb.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            (source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION) &&
            !this.isInsideOfWater()) && super.attack(source);
}
 
Example 8
Source File: EntityItem.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.CONTACT ||
            source.getCause() == DamageCause.FIRE_TICK ||
            (source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION) &&
            !this.isInsideOfWater() && (this.item == null ||
            this.item.getId() != Item.NETHER_STAR)) && super.attack(source);
}
 
Example 9
Source File: EnchantmentProtectionAll.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public float getDamageProtection(EntityDamageEvent e) {
    DamageCause cause = e.getCause();

    if (level <= 0 || cause == DamageCause.VOID || cause == DamageCause.CUSTOM || cause == DamageCause.MAGIC) {
        return 0;
    }

    return (float) (getLevel() * getTypeModifier());
}
 
Example 10
Source File: EntityItem.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return (source.getCause() == DamageCause.VOID ||
            source.getCause() == DamageCause.FIRE_TICK ||
            source.getCause() == DamageCause.ENTITY_EXPLOSION ||
            source.getCause() == DamageCause.BLOCK_EXPLOSION)
            && super.attack(source);
}
 
Example 11
Source File: EntityPrimedTNT.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 12
Source File: EntityFallingBlock.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 13
Source File: EntityProjectile.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 14
Source File: EntityProjectile.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 15
Source File: EntityFallingBlock.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 16
Source File: EntityPrimedTNT.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 17
Source File: EntityPrimedTNT.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 18
Source File: EntityFallingBlock.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}
 
Example 19
Source File: EntityProjectile.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public boolean attack(EntityDamageEvent source) {
    return source.getCause() == DamageCause.VOID && super.attack(source);
}