Search in sources :

Example 11 with EntityHuman

use of net.minecraft.server.v1_9_R1.EntityHuman in project Village_Defense by Plajer.

the class RidableIronGolem method a.

public void a(float f, float f1, float f2) {
    EntityLiving entityliving = null;
    for (final Entity e : passengers) {
        if (e instanceof EntityHuman) {
            entityliving = (EntityLiving) e;
            break;
        }
    }
    if (entityliving == null) {
        this.P = 0.5F;
        this.aR = 0.02F;
        this.k((float) 0.12);
        super.a(f, f1, f2);
        return;
    }
    this.lastYaw = this.yaw = entityliving.yaw;
    this.pitch = entityliving.pitch * 0.5F;
    this.setYawPitch(this.yaw, this.pitch);
    this.aO = this.aM = this.yaw;
    f = entityliving.be * 0.5F * 0.75F;
    f2 = entityliving.bg;
    if (f2 <= 0.0f) {
        f2 *= 0.25F;
    }
    k(0.12f);
    super.a(f, f1, f2);
    P = (float) 1.0;
}
Also used : Entity(net.minecraft.server.v1_12_R1.Entity) EntityHuman(net.minecraft.server.v1_12_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_12_R1.EntityLiving)

Example 12 with EntityHuman

use of net.minecraft.server.v1_9_R1.EntityHuman in project Village_Defense by Plajer.

the class RidableVillager method g.

@Override
public void g(float f, float f1) {
    EntityLiving entityliving = (EntityLiving) bt();
    if (entityliving == null) {
        for (final Entity e : passengers) {
            if (e instanceof EntityHuman) {
                entityliving = (EntityLiving) e;
                break;
            }
        }
        if (entityliving == null) {
            P = 0.5f;
            this.l((float) 0.12);
            super.g(f, f1);
            return;
        }
    }
    final float yaw = entityliving.yaw;
    this.yaw = yaw;
    lastYaw = yaw;
    pitch = entityliving.pitch * 0.5f;
    setYawPitch(this.yaw, pitch);
    final float yaw2 = this.yaw;
    aM = yaw2;
    aO = yaw2;
    f = entityliving.bd * 0.75F;
    f1 = entityliving.be;
    if (f1 <= 0.0f) {
        f1 *= 0.25F;
    }
    this.l((float) 0.12);
    super.g(f, f1);
    P = 1.0F;
}
Also used : Entity(net.minecraft.server.v1_9_R1.Entity) EntityHuman(net.minecraft.server.v1_9_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_9_R1.EntityLiving)

Example 13 with EntityHuman

use of net.minecraft.server.v1_9_R1.EntityHuman in project Village_Defense by Plajer.

the class RidableVillager method a.

public void a(float f, float f1, float f2) {
    EntityLiving entityliving = null;
    for (final Entity e : passengers) {
        if (e instanceof EntityHuman) {
            entityliving = (EntityLiving) e;
            break;
        }
    }
    if (entityliving == null) {
        this.P = 0.5F;
        this.aR = 0.02F;
        this.k((float) 0.12);
        super.a(f, f1, f2);
        return;
    }
    this.lastYaw = this.yaw = entityliving.yaw;
    this.pitch = entityliving.pitch * 0.5F;
    this.setYawPitch(this.yaw, this.pitch);
    this.aO = this.aM = this.yaw;
    f = entityliving.be * 0.5F * 0.75F;
    f2 = entityliving.bg;
    if (f2 <= 0.0f) {
        f2 *= 0.25F;
    }
    k(0.12f);
    super.a(f, f1, f2);
    P = (float) 1.0;
}
Also used : Entity(net.minecraft.server.v1_12_R1.Entity) EntityHuman(net.minecraft.server.v1_12_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_12_R1.EntityLiving)

Example 14 with EntityHuman

use of net.minecraft.server.v1_9_R1.EntityHuman in project Village_Defense by Plajer.

the class RidableVillager method g.

@Override
public void g(float f, float f1) {
    EntityLiving entityliving = (EntityLiving) bw();
    if (entityliving == null) {
        // search first human passenger
        for (final Entity e : passengers) {
            if (e instanceof EntityHuman) {
                entityliving = (EntityLiving) e;
                break;
            }
        }
        if (entityliving == null) {
            this.l((float) 0.12);
            super.g(f, f1);
            return;
        }
    }
    this.lastYaw = this.yaw = entityliving.yaw;
    this.pitch = entityliving.pitch * 0.5F;
    this.setYawPitch(this.yaw, this.pitch);
    this.aQ = this.aO = this.yaw;
    f = entityliving.be * 0.75F;
    f1 = entityliving.bf;
    if (f1 <= 0.0f) {
        f1 *= 0.25F;
    }
    this.l((float) 0.12);
    super.g(f, f1);
    P = (float) 1.0;
}
Also used : Entity(net.minecraft.server.v1_11_R1.Entity) EntityHuman(net.minecraft.server.v1_11_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_11_R1.EntityLiving)

Example 15 with EntityHuman

use of net.minecraft.server.v1_9_R1.EntityHuman in project Village_Defense by Plajer.

the class RidableIronGolem method g.

@Override
public void g(float f, float f1) {
    EntityLiving entityliving = (EntityLiving) bt();
    if (entityliving == null) {
        for (final Entity e : passengers) {
            if (e instanceof EntityHuman) {
                entityliving = (EntityLiving) e;
                break;
            }
        }
        if (entityliving == null) {
            P = 0.5f;
            this.l((float) 0.12);
            super.g(f, f1);
            return;
        }
    }
    final float yaw = entityliving.yaw;
    this.yaw = yaw;
    lastYaw = yaw;
    pitch = entityliving.pitch * 0.5f;
    setYawPitch(this.yaw, pitch);
    final float yaw2 = this.yaw;
    aM = yaw2;
    aO = yaw2;
    f = entityliving.bd * 0.75F;
    f1 = entityliving.be;
    if (f1 <= 0.0f) {
        f1 *= 0.25F;
    }
    this.l((float) 0.12);
    super.g(f, f1);
    P = 1.0F;
}
Also used : Entity(net.minecraft.server.v1_9_R1.Entity) EntityHuman(net.minecraft.server.v1_9_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_9_R1.EntityLiving)

Aggregations

LivingEntity (org.bukkit.entity.LivingEntity)8 EntityHuman (net.minecraft.server.v1_11_R1.EntityHuman)6 EntityHuman (net.minecraft.server.v1_12_R1.EntityHuman)5 EntityHuman (net.minecraft.server.v1_8_R3.EntityHuman)5 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)4 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)4 EntityHuman (net.minecraft.server.v1_10_R1.EntityHuman)4 Entity (net.minecraft.server.v1_11_R1.Entity)3 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)3 Entity (net.minecraft.server.v1_12_R1.Entity)3 EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)3 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)2 Entity (net.minecraft.server.v1_8_R3.Entity)2 Entity (net.minecraft.server.v1_9_R1.Entity)2 EntityHuman (net.minecraft.server.v1_9_R1.EntityHuman)2 EntityLiving (net.minecraft.server.v1_9_R1.EntityLiving)2 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)1 CrashReport (net.minecraft.server.v1_10_R1.CrashReport)1 CrashReportSystemDetails (net.minecraft.server.v1_10_R1.CrashReportSystemDetails)1 Entity (net.minecraft.server.v1_10_R1.Entity)1