Java Code Examples for net.minecraft.util.DamageSource#outOfWorld()
The following examples show how to use
net.minecraft.util.DamageSource#outOfWorld() .
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: ItemHeartUpgrade.java From Cyberware with MIT License | 5 votes |
protected float applyPotionDamageCalculations(EntityLivingBase e, DamageSource source, float damage) { if (source.isDamageAbsolute()) { return damage; } else { if (e.isPotionActive(MobEffects.RESISTANCE) && source != DamageSource.outOfWorld) { int i = (e.getActivePotionEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5; int j = 25 - i; float f = damage * (float)j; damage = f / 25.0F; } if (damage <= 0.0F) { return 0.0F; } else { int k = EnchantmentHelper.getEnchantmentModifierDamage(e.getArmorInventoryList(), source); if (k > 0) { damage = CombatRules.getDamageAfterMagicAbsorb(damage, (float)k); } return damage; } } }
Example 2
Source File: EntityWirelessTracker.java From WirelessRedstone with MIT License | 5 votes |
@Override public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if(par1DamageSource == DamageSource.lava || par1DamageSource == DamageSource.outOfWorld) { setDead(); return true; } return false; }