Fix Sacrificial Runes not affect sacrifice amount (#713)

This commit is contained in:
Nick 2016-04-17 00:03:53 -07:00
parent 8ddd95b294
commit 458f8810b6
3 changed files with 7 additions and 5 deletions

View file

@ -69,7 +69,7 @@ public class PlayerSacrificeHelper
{ {
float sacrificedHealth = health - maxHealth / 10.0f; float sacrificedHealth = health - maxHealth / 10.0f;
if (findAndFillAltar(player.getEntityWorld(), player, (int) (sacrificedHealth * 100f * getModifier(amount)))) if (findAndFillAltar(player.getEntityWorld(), player, (int) (sacrificedHealth * 100f * getModifier(amount)), false))
{ {
player.setHealth(maxHealth / 10.0f); player.setHealth(maxHealth / 10.0f);
setPlayerIncense(player, 0); setPlayerIncense(player, 0);
@ -97,17 +97,19 @@ public class PlayerSacrificeHelper
* - The entity having the sacrifice done on (can be {@link EntityPlayer} for self-sacrifice) * - The entity having the sacrifice done on (can be {@link EntityPlayer} for self-sacrifice)
* @param amount * @param amount
* - The amount of which the altar should be filled * - The amount of which the altar should be filled
* @param isSacrifice
* - Whether this is a Sacrifice or a Self-Sacrifice
* *
* @return Whether the altar is found and (attempted) filled * @return Whether the altar is found and (attempted) filled
*/ */
public static boolean findAndFillAltar(World world, EntityLivingBase sacrificingEntity, int amount) public static boolean findAndFillAltar(World world, EntityLivingBase sacrificingEntity, int amount, boolean isSacrifice)
{ {
IBloodAltar altarEntity = getAltar(world, sacrificingEntity.getPosition()); IBloodAltar altarEntity = getAltar(world, sacrificingEntity.getPosition());
if (altarEntity == null) if (altarEntity == null)
return false; return false;
altarEntity.sacrificialDaggerCall(amount, false); altarEntity.sacrificialDaggerCall(amount, isSacrifice);
altarEntity.startCycle(); altarEntity.startCycle();
return true; return true;

View file

@ -52,7 +52,7 @@ 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 (PlayerSacrificeHelper.findAndFillAltar(attacker.worldObj, target, lifeEssence)) 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);
target.setHealth(-1); target.setHealth(-1);

View file

@ -148,7 +148,7 @@ public class ItemSacrificialDagger extends Item implements IVariantProvider
return super.onItemRightClick(stack, world, player, hand); return super.onItemRightClick(stack, world, player, hand);
// TODO - Check if SoulFray is active // TODO - Check if SoulFray is active
PlayerSacrificeHelper.findAndFillAltar(world, player, lpAdded); PlayerSacrificeHelper.findAndFillAltar(world, player, lpAdded, false);
return super.onItemRightClick(stack, world, player, hand); return super.onItemRightClick(stack, world, player, hand);
} }