fix loss of the block

This commit is contained in:
Mark Zharkov committed 2025-02-06 22:38:44 +03:00
1 parent 21a1dd0ba9
commit 37ad1755fd
1 file changed
+7 -7
@@ -31,16 +31,16 @@ public class JobHealer extends JobInterface{
speed = nbttagcompound.getInteger("HealerSpeed");
}
private List<EntityLivingBase> toHeal = new ArrayList<EntityLivingBase>();
//TODO heal food, heal potion effects, heal more types of entities besides just the player and npcs
public boolean aiShouldExecute() {
healTicks++;
if (healTicks < speed * 10)
if (healTicks < speed * 10)
return false;
for(Object plObj: npc.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, npc.boundingBox.expand(range, range/2, range))){
for(Object plObj: npc.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, npc.boundingBox.expand(range, range/2.0, range))){
EntityLivingBase entity = (EntityLivingBase) plObj;
if(entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) entity;
if(player.getHealth() < player.getMaxHealth() && !npc.faction.isAggressiveToPlayer(player))
@@ -51,7 +51,7 @@ public class JobHealer extends JobInterface{
if(npc.getHealth() < npc.getMaxHealth() && !this.npc.faction.isAggressiveToNpc(npc))
toHeal.add(npc);
}
}
healTicks = 0;
@@ -65,7 +65,7 @@ public class JobHealer extends JobInterface{
}
toHeal.clear();
}
public void heal(EntityLivingBase entity, float amount){
entity.heal(amount);
NoppesUtilServer.spawnParticle(entity, "heal",entity.dimension);