Altar and Dagger should respect 0 LP as an effective blacklist (#837)

This commit is contained in:
Nicholas Ignoffo 2016-07-04 20:17:23 -07:00
parent 14b448bbee
commit 7fdbcf3b3c
2 changed files with 18 additions and 11 deletions

View file

@ -52,6 +52,9 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
if (BloodMagicAPI.getEntitySacrificeValues().containsKey(entityName)) if (BloodMagicAPI.getEntitySacrificeValues().containsKey(entityName))
lifeEssence = BloodMagicAPI.getEntitySacrificeValues().get(entityName); lifeEssence = BloodMagicAPI.getEntitySacrificeValues().get(entityName);
if (lifeEssence <= 0)
return false;
if (PlayerSacrificeHelper.findAndFillAltar(attacker.worldObj, target, lifeEssence, true)) if (PlayerSacrificeHelper.findAndFillAltar(attacker.worldObj, target, lifeEssence, true))
{ {
target.worldObj.playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.worldObj.rand.nextFloat() - target.worldObj.rand.nextFloat()) * 0.8F); target.worldObj.playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.worldObj.rand.nextFloat() - target.worldObj.rand.nextFloat()) * 0.8F);

View file

@ -1,6 +1,7 @@
package WayofTime.bloodmagic.ritual; package WayofTime.bloodmagic.ritual;
import WayofTime.bloodmagic.ConfigHandler; import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.saving.SoulNetwork; import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.*; import WayofTime.bloodmagic.api.ritual.*;
@ -87,20 +88,23 @@ public class RitualWellOfSuffering extends Ritual
for (EntityLivingBase entity : entities) for (EntityLivingBase entity : entities)
{ {
if (!ConfigHandler.wellOfSufferingBlacklist.contains(entity.getClass().getSimpleName())) if (ConfigHandler.wellOfSufferingBlacklist.contains(entity.getClass().getSimpleName()))
continue;
if (BloodMagicAPI.getEntitySacrificeValues().get(entity.getClass().getSimpleName()) <= 0)
continue;
if (entity.isEntityAlive() && !(entity instanceof EntityPlayer))
{ {
if (entity.isEntityAlive() && !(entity instanceof EntityPlayer)) if (entity.attackEntityFrom(DamageSource.outOfWorld, 1))
{ {
if (entity.attackEntityFrom(DamageSource.outOfWorld, 1)) tileAltar.sacrificialDaggerCall(SACRIFICE_AMOUNT, true);
totalEffects++;
if (totalEffects >= maxEffects)
{ {
tileAltar.sacrificialDaggerCall(SACRIFICE_AMOUNT, true); break;
totalEffects++;
if (totalEffects >= maxEffects)
{
break;
}
} }
} }
} }