Fix Regen ritual so it affects non-player entities too (#906)
This commit is contained in:
parent
30cf11075b
commit
8f6bb85362
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.ritual;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.MobEffects;
|
import net.minecraft.init.MobEffects;
|
||||||
|
@ -53,14 +54,14 @@ public class RitualRegeneration extends Ritual
|
||||||
AreaDescriptor damageRange = getBlockRange(HEAL_RANGE);
|
AreaDescriptor damageRange = getBlockRange(HEAL_RANGE);
|
||||||
AxisAlignedBB range = damageRange.getAABB(pos);
|
AxisAlignedBB range = damageRange.getAABB(pos);
|
||||||
|
|
||||||
List<EntityPlayer> entities = world.getEntitiesWithinAABB(EntityPlayer.class, range);
|
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, range);
|
||||||
|
|
||||||
for (EntityLivingBase player : entities)
|
for (EntityLivingBase entity : entities)
|
||||||
{
|
{
|
||||||
float health = player.getHealth();
|
float health = entity.getHealth();
|
||||||
if (health <= player.getMaxHealth() - 1)
|
if (health <= entity.getMaxHealth() - 1)
|
||||||
{
|
{
|
||||||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50, 0, false, false));
|
entity.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50, 0, false, false));
|
||||||
|
|
||||||
totalEffects++;
|
totalEffects++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue