Altar and Dagger should respect 0 LP as an effective blacklist (#837)
This commit is contained in:
parent
14b448bbee
commit
7fdbcf3b3c
|
@ -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);
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue