Search in sources :

Example 56 with EntityLiving

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

Example 57 with EntityLiving

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

the class NMSImpl method setHeadYaw.

@Override
public void setHeadYaw(org.bukkit.entity.Entity entity, float yaw) {
    if (!(entity instanceof LivingEntity))
        return;
    EntityLiving handle = (EntityLiving) getHandle(entity);
    yaw = Util.clampYaw(yaw);
    handle.aJ = yaw;
    if (!(handle instanceof EntityHuman))
        handle.aI = yaw;
    handle.aK = yaw;
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) EntityHuman(net.minecraft.server.v1_8_R3.EntityHuman) EntityLiving(net.minecraft.server.v1_8_R3.EntityLiving)

Example 58 with EntityLiving

use of net.minecraft.server.v1_7_R4.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).g((EntityHuman) equipperHandle);
    horse.setTamed(wasTamed);
}
Also used : EntityHorse(net.minecraft.server.v1_8_R3.EntityHorse) EntityLiving(net.minecraft.server.v1_8_R3.EntityLiving)

Example 59 with EntityLiving

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

the class NMSImpl method setHeadYaw.

@Override
public void setHeadYaw(org.bukkit.entity.Entity entity, float yaw) {
    if (!(entity instanceof LivingEntity))
        return;
    EntityLiving handle = (EntityLiving) getHandle(entity);
    yaw = Util.clampYaw(yaw);
    handle.aO = yaw;
    if (!(handle instanceof EntityHuman)) {
        handle.aN = yaw;
    }
    handle.aP = yaw;
}
Also used : LivingEntity(org.bukkit.entity.LivingEntity) EntityHuman(net.minecraft.server.v1_11_R1.EntityHuman) EntityLiving(net.minecraft.server.v1_11_R1.EntityLiving)

Example 60 with EntityLiving

use of net.minecraft.server.v1_7_R4.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);
    ((EntityHorseAbstract) handle).c((EntityHuman) equipperHandle);
    horse.setTamed(wasTamed);
}
Also used : EntityLiving(net.minecraft.server.v1_12_R1.EntityLiving) EntityHorseAbstract(net.minecraft.server.v1_12_R1.EntityHorseAbstract)

Aggregations

EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)14 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)12 EntityLiving (net.minecraft.server.v1_10_R1.EntityLiving)10 EntityLiving (net.minecraft.server.v1_8_R3.EntityLiving)10 MyPet (de.Keyle.MyPet.api.entity.MyPet)9 Behavior (de.Keyle.MyPet.skill.skills.Behavior)9 Player (org.bukkit.entity.Player)9 EntityLiving (net.minecraft.server.v1_9_R1.EntityLiving)5 LivingEntity (org.bukkit.entity.LivingEntity)5 EntityHuman (net.minecraft.server.v1_11_R1.EntityHuman)3 EntityHuman (net.minecraft.server.v1_12_R1.EntityHuman)3 EntityLiving (net.minecraft.server.v1_7_R4.EntityLiving)3 EntityHumanNPC (net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)2 AttributeInstance (net.minecraft.server.v1_10_R1.AttributeInstance)2 EntityArmorStand (net.minecraft.server.v1_10_R1.EntityArmorStand)2 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)2 AttributeInstance (net.minecraft.server.v1_11_R1.AttributeInstance)2 Entity (net.minecraft.server.v1_11_R1.Entity)2 EntityArmorStand (net.minecraft.server.v1_11_R1.EntityArmorStand)2 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)2