Added EntitySpider and EntityPigZombie conditions

This commit is contained in:
Baddeveloper 2019-07-12 19:12:00 +02:00
parent ce4b1e09ed
commit b16f9edd2c

View File

@ -22,6 +22,8 @@ import baritone.api.utils.BetterBlockPos;
import baritone.api.utils.IPlayerContext; import baritone.api.utils.IPlayerContext;
import it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap;
import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.ArrayList; import java.util.ArrayList;
@ -70,6 +72,8 @@ public class Avoidance {
if (mobCoeff != 1.0D) { if (mobCoeff != 1.0D) {
ctx.world().loadedEntityList.stream() ctx.world().loadedEntityList.stream()
.filter(entity -> entity instanceof EntityMob) .filter(entity -> entity instanceof EntityMob)
.filter(entity -> (!(entity instanceof EntitySpider)) || ctx.player().getBrightness() < 0.5)
.filter(entity -> !(entity instanceof EntityPigZombie) || ((EntityPigZombie) entity).isAngry())
.forEach(entity -> res.add(new Avoidance(new BlockPos(entity), mobCoeff, Baritone.settings().mobAvoidanceRadius.value))); .forEach(entity -> res.add(new Avoidance(new BlockPos(entity), mobCoeff, Baritone.settings().mobAvoidanceRadius.value)));
} }
return res; return res;