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))
lifeEssence = BloodMagicAPI.getEntitySacrificeValues().get(entityName);
if (lifeEssence <= 0)
return false;
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);

View file

@ -1,6 +1,7 @@
package WayofTime.bloodmagic.ritual;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.*;
@ -87,8 +88,12 @@ public class RitualWellOfSuffering extends Ritual
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.attackEntityFrom(DamageSource.outOfWorld, 1))
@ -105,7 +110,6 @@ public class RitualWellOfSuffering extends Ritual
}
}
}
}
network.syphon(getRefreshCost() * totalEffects);
}