Search in sources :

Example 66 with EntityLiving

use of net.minecraft.server.v1_8_R3.EntityLiving 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)

Example 67 with EntityLiving

use of net.minecraft.server.v1_8_R3.EntityLiving in project Citizens2 by CitizensDev.

the class NMSImpl method setVerticalMovement.

@Override
public void setVerticalMovement(org.bukkit.entity.Entity bukkitEntity, double d) {
    if (!bukkitEntity.getType().isAlive())
        return;
    EntityLiving handle = NMSImpl.getHandle((LivingEntity) bukkitEntity);
    handle.bf = (float) d;
}
Also used : EntityLiving(net.minecraft.server.v1_10_R1.EntityLiving)

Example 68 with EntityLiving

use of net.minecraft.server.v1_8_R3.EntityLiving in project Citizens2 by CitizensDev.

the class NMSImpl method openHorseScreen.

@Override
public void openHorseScreen(Tameable horse, Player equipper) {
    EntityLiving handle = NMSImpl.getHandle((LivingEntity) horse);
    EntityLiving equipperHandle = NMSImpl.getHandle(equipper);
    if (handle == null || equipperHandle == null)
        return;
    boolean wasTamed = horse.isTamed();
    horse.setTamed(true);
    ((EntityHorse) handle).f((EntityHuman) equipperHandle);
    horse.setTamed(wasTamed);
}
Also used : EntityHorse(net.minecraft.server.v1_10_R1.EntityHorse) EntityLiving(net.minecraft.server.v1_10_R1.EntityLiving)

Example 69 with EntityLiving

use of net.minecraft.server.v1_8_R3.EntityLiving in project Citizens2 by CitizensDev.

the class NMSImpl method setKnockbackResistance.

@Override
public void setKnockbackResistance(LivingEntity entity, double d) {
    EntityLiving handle = NMSImpl.getHandle(entity);
    handle.getAttributeInstance(GenericAttributes.c).setValue(d);
}
Also used : EntityLiving(net.minecraft.server.v1_10_R1.EntityLiving)

Example 70 with EntityLiving

use of net.minecraft.server.v1_8_R3.EntityLiving in project Citizens2 by CitizensDev.

the class CitizensBlockBreaker method strengthMod.

private float strengthMod(Block block) {
    ItemStack itemstack = getCurrentItem();
    float f = itemstack.a(block);
    if (entity instanceof EntityLiving) {
        EntityLiving handle = (EntityLiving) entity;
        if (f > 1.0F) {
            int i = EnchantmentManager.getDigSpeedEnchantmentLevel(handle);
            if (i > 0) {
                f += i * i + 1;
            }
        }
        if (handle.hasEffect(MobEffectList.FASTER_DIG)) {
            f *= (1.0F + (handle.getEffect(MobEffectList.FASTER_DIG).getAmplifier() + 1) * 0.2F);
        }
        if (handle.hasEffect(MobEffectList.SLOWER_DIG)) {
            float f1 = 1.0F;
            switch(handle.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) {
                case 0:
                    f1 = 0.3F;
                    break;
                case 1:
                    f1 = 0.09F;
                    break;
                case 2:
                    f1 = 0.0027F;
                    break;
                case 3:
                default:
                    f1 = 8.1E-4F;
            }
            f *= f1;
        }
        if ((handle.a(Material.WATER)) && (!EnchantmentManager.j(handle))) {
            f /= 5.0F;
        }
    }
    if (!entity.onGround) {
        f /= 5.0F;
    }
    return f;
}
Also used : EntityLiving(net.minecraft.server.v1_8_R3.EntityLiving) ItemStack(net.minecraft.server.v1_8_R3.ItemStack) CraftItemStack(org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack)

Aggregations

Behavior (de.Keyle.MyPet.api.skill.skills.Behavior)21 EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)16 EntityLiving (net.minecraft.server.v1_8_R3.EntityLiving)13 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)12 MyPet (de.Keyle.MyPet.api.entity.MyPet)11 Player (org.bukkit.entity.Player)11 EntityLiving (net.minecraft.server.v1_10_R1.EntityLiving)10 Behavior (de.Keyle.MyPet.skill.skills.Behavior)6 SprintImpl (de.Keyle.MyPet.skill.skills.SprintImpl)5 EntityLiving (net.minecraft.server.v1_16_R1.EntityLiving)5 EntityLiving (net.minecraft.server.v1_9_R1.EntityLiving)5 EntityLiving (net.minecraft.server.v1_9_R2.EntityLiving)5 CraftLivingEntity (org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity)5 CraftLivingEntity (org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity)5 LivingEntity (org.bukkit.entity.LivingEntity)5 EntityLiving (net.minecraft.server.v1_16_R3.EntityLiving)4 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)4 CraftLivingEntity (org.bukkit.craftbukkit.v1_16_R1.entity.CraftLivingEntity)4 CraftPlayer (org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer)4 CraftLivingEntity (org.bukkit.craftbukkit.v1_9_R2.entity.CraftLivingEntity)4