Search in sources :

Example 1 with PredictedEntity

use of me.wallhacks.spark.util.objects.PredictedEntity in project Spark-Client by Spark-Client-Development.

the class CrystalAura method getValueForCrystalExplodingAtPoint.

// methods to calculate crystal things
ValueForExplodingCrystalAtPoint getValueForCrystalExplodingAtPoint(Vec3d pos, boolean prePlace) {
    float bestValue = -1;
    float myhealth = mc.player.getHealth() + mc.player.getAbsorptionAmount();
    float selfdam = CrystalUtil.calculateDamageCrystal(pos, predictedPlayer, prePlace);
    PredictedEntity target = null;
    boolean facePlace = false;
    if (selfdam + 2 < myhealth || !NoSuicide.isOn())
        if (maxSelfdamage.getValue() > selfdam || maxSelfdamage.getValue() == 0) {
            for (PredictedEntity ct : predictedEnemies) {
                EntityLivingBase e = ct.entity;
                float d = (float) (CrystalUtil.calculateDamageCrystal(pos, ct, prePlace) - selfdam * protectSelf.getValue());
                double minD = minEnemydamage.getValue();
                boolean f = false;
                if (d < minD)
                    if (e.getHealth() + e.getAbsorptionAmount() < facePlaceHealth.getValue() || facePlaceKey.isDown() || armor(e)) {
                        f = true;
                        minD = 1.5D;
                    }
                if (d > Math.max(minD, bestValue)) {
                    bestValue = d;
                    facePlace = f;
                    target = ct;
                }
            }
        }
    return new ValueForExplodingCrystalAtPoint(target, bestValue, facePlace);
}
Also used : PredictedEntity(me.wallhacks.spark.util.objects.PredictedEntity) EntityLivingBase(net.minecraft.entity.EntityLivingBase)

Example 2 with PredictedEntity

use of me.wallhacks.spark.util.objects.PredictedEntity in project Spark-Client by Spark-Client-Development.

the class CrystalAura method predictTarget.

void predictTarget() {
    predictedPlayer = new PredictedEntity(mc.player, prediction.getValue());
    predictedEnemies.clear();
    for (Entity e : mc.world.loadedEntityList) {
        if (e instanceof EntityLivingBase)
            if (e != mc.player)
                if (!PlayersOnly.isOn() || e instanceof EntityPlayer)
                    if (AttackUtil.canAttackEntity((EntityLivingBase) e, 15))
                        predictedEnemies.add(new PredictedEntity((EntityLivingBase) e, prediction.getValue()));
    }
}
Also used : PredictedEntity(me.wallhacks.spark.util.objects.PredictedEntity) PredictedEntity(me.wallhacks.spark.util.objects.PredictedEntity) Entity(net.minecraft.entity.Entity) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Aggregations

PredictedEntity (me.wallhacks.spark.util.objects.PredictedEntity)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 Entity (net.minecraft.entity.Entity)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1