Child mobs are now viable for sacrifice at half the rate

(cherry picked from commit 719cff0)
This commit is contained in:
Nicholas Ignoffo 2017-02-25 18:00:17 -08:00
parent 6ac31ba1e8
commit 8360041da2
2 changed files with 13 additions and 1 deletions

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -47,7 +48,10 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
if (!target.isNonBoss())
return false;
if (target.isChild() || target instanceof EntityPlayer)
if (target instanceof EntityPlayer)
return false;
if (target.isChild() && !(target instanceof IMob))
return false;
if (target.isDead || target.getHealth() < 0.5F)
@ -71,6 +75,11 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
lifeEssence = (int) (lifeEssence * (1 + PurificationHelper.getCurrentPurity((EntityAnimal) target)));
}
if (target.isChild())
{
lifeEssence *= 0.5F;
}
if (PlayerSacrificeHelper.findAndFillAltar(attacker.getEntityWorld(), target, lifeEssence, true))
{
target.getEntityWorld().playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.getEntityWorld().rand.nextFloat() - target.getEntityWorld().rand.nextFloat()) * 0.8F);

View file

@ -106,6 +106,9 @@ public class RitualWellOfSuffering extends Ritual
if (BloodMagicAPI.getEntitySacrificeValues().containsKey(entityName))
lifeEssenceRatio = BloodMagicAPI.getEntitySacrificeValues().get(entityName);
if (entity.isChild())
lifeEssenceRatio *= 0.5F;
tileAltar.sacrificialDaggerCall(lifeEssenceRatio, true);
totalEffects++;