@Override public boolean attackEntityFrom( final DamageSource src, final float dmg ) { if( src.isExplosion() ) { this.doExplosion(); return false; } return super.attackEntityFrom( src, dmg ); }
@Override boolean isSourceValid(DamageSource source) { return source.isExplosion(); } },
public float getScaledDamage(DamageSource src, float amt) { if (src == DamageType.explosiveMissile || src.isExplosion()) { return amt * (1 - (vehicle.currentExplosionResist * 0.01f)); } else if (src == DamageType.fireMissile || src == DamageSource.IN_FIRE || src == DamageSource.LAVA || src == DamageSource.ON_FIRE || src.isFireDamage()) { return amt * (1 - (vehicle.currentFireResist * 0.01f)); } return amt * (1 - (vehicle.currentGenericResist * 0.01f)); }
@Override public boolean attackEntityFrom(DamageSource source, float damage) { if (source.isExplosion()) return false; return super.attackEntityFrom(source, damage); }
public boolean isEntityInvulnerable(DamageSource source) { return super.isEntityInvulnerable(source) && (this.type == EnumDemonWillType.DESTRUCTIVE && source.isExplosion()); }
boolean isDamageValid(DamageSource damageSource) { return damageSource.isExplosion() || damageSource.isProjectile(); }
@Override public int getDamageReductionAmount(EntityEquipmentSlot slot, DamageSource source) { if (source.isExplosion()) { return ItemArmor.ArmorMaterial.DIAMOND.getDamageReductionAmount(slot); } return super.getDamageReductionAmount(slot, source); } }
@Override public ArmorProperties getProperties(EntityLivingBase player, @Nonnull ItemStack armor, DamageSource source, double damage, int slot) { EntityEquipmentSlot type = ((RMArmor) armor.getItem()).armorType; if (source.isExplosion()) { return new ArmorProperties(1, 1.0D, 500); } if (type == EntityEquipmentSlot.HEAD && source == DamageSource.FALL) { return new ArmorProperties(1, 1.0D, 10); } if (type == EntityEquipmentSlot.HEAD || type == EntityEquipmentSlot.FEET) { return new ArmorProperties(0, 0.2D, 250); } return new ArmorProperties(0, 0.3D, 350); }
@Override public ArmorProperties getProperties(EntityLivingBase player, @Nonnull ItemStack armor, DamageSource source, double damage, int slot) { EntityEquipmentSlot type = ((DMArmor) armor.getItem()).armorType; if (source.isExplosion()) { return new ArmorProperties(1, 1.0D, 350); } if (type == EntityEquipmentSlot.HEAD && source == DamageSource.FALL) { return new ArmorProperties(1, 1.0D, 5); } if (type == EntityEquipmentSlot.HEAD || type == EntityEquipmentSlot.FEET) { return new ArmorProperties(0, 0.2D, 100); } return new ArmorProperties(0, 0.3D, 150); }
@Override public ArmorProperties getProperties(EntityLivingBase player, @Nonnull ItemStack armor, DamageSource source, double damage, int slot) { EntityEquipmentSlot type = ((GemArmorBase) armor.getItem()).armorType; if (source.isExplosion()) { return new ArmorProperties(1, 1.0D, 750); } if (type == EntityEquipmentSlot.FEET && source == DamageSource.FALL) { return new ArmorProperties(1, 1.0D, 15); } if (type == EntityEquipmentSlot.HEAD || type == EntityEquipmentSlot.FEET) { return new ArmorProperties(0, 0.2D, 400); } return new ArmorProperties(0, 0.3D, 500); }
@Override public boolean attackEntityFrom(DamageSource damageSource, float amount) { if (isInsensitiveTo(damageSource) || amount < 0) { return false; } if (this.world.isRemote) { return true; } if (!damageSource.isExplosion()) { if (this.hurtInvulTicks > 0) { return false; } this.hurtInvulTicks = 10; } this.setHealth((int) (getHealth() - amount)); if (getHealth() <= 0) { this.setDead(); } return !this.isDead; }
@Override public void onPlayerAttacksOther(LivingAttackEvent event, EntityPlayer victim, @Nonnull ItemStack armorStack, EntityEquipmentSlot slot) { // Explosions must be ignored in order to prevent infinite recursive hearMeRoar calls. DamageSource source = event.getSource(); Entity sourceEntity = source.getTrueSource(); if (sourceEntity instanceof EntityLivingBase && !source.isExplosion()) { EntityLivingBase entity = (EntityLivingBase) sourceEntity; World world = entity.world; ItemStack chest = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST); if (entity.getHeldItemMainhand().isEmpty() && entity.isSneaking() && chest.getItem() instanceof ItemSteamExosuitArmor && chest.hasTagCompound()) { int consumption = (chest.getTagCompound().getInteger("SteamCapacity") / 2) + ArmorModule.dragonRoarConsumption; if (ChargableUtility.hasPower(entity, consumption)) { if (world.isRemote) { world.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.ENTITY_ENDERDRAGON_GROWL, SoundCategory.PLAYERS, 5.0F, 0.8F + world.rand.nextFloat() * 0.3F, false); } else { world.createExplosion(entity, entity.posX + 0.5F, entity.posY, entity.posZ + 0.5F, 10.0F, false); } ChargableUtility.drainSteam(chest, consumption, entity); } } } } }
return null; if (explosionOnly && !((LivingDeathEvent) event).getSource().isExplosion()) { return null;