Search in sources :

Example 6 with CraftLivingEntity

use of org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.

the class MeleeAttack method shouldStart.

@Override
public boolean shouldStart() {
    if (myPet.getDamage() <= 0) {
        return false;
    }
    if (!this.petEntity.hasTarget()) {
        return false;
    }
    EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
    if (targetEntity instanceof EntityArmorStand) {
        return false;
    }
    if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.f(targetEntity.locX, targetEntity.getBoundingBox().b, targetEntity.locZ) >= 20) {
        return false;
    }
    this.targetEntity = targetEntity;
    return true;
}
Also used : EntityLiving(net.minecraft.server.v1_8_R3.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity) EntityArmorStand(net.minecraft.server.v1_8_R3.EntityArmorStand)

Example 7 with CraftLivingEntity

use of org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.

the class Sprint method shouldStart.

@Override
public boolean shouldStart() {
    if (!myPet.getSkills().isSkillActive(de.Keyle.MyPet.skill.skills.Sprint.class)) {
        return false;
    }
    if (petEntity.getMyPet().getDamage() <= 0) {
        return false;
    }
    if (!this.petEntity.hasTarget()) {
        return false;
    }
    EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
    if (!targetEntity.isAlive()) {
        return false;
    }
    if (lastTarget == targetEntity) {
        return false;
    }
    if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.h(targetEntity) >= 16) {
        return false;
    }
    this.lastTarget = targetEntity;
    return true;
}
Also used : EntityLiving(net.minecraft.server.v1_8_R3.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity)

Example 8 with CraftLivingEntity

use of org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.

the class MeleeAttack method shouldStart.

@Override
public boolean shouldStart() {
    if (myPet.getDamage() <= 0) {
        return false;
    }
    if (!this.petEntity.hasTarget()) {
        return false;
    }
    EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
    if (targetEntity instanceof EntityArmorStand) {
        return false;
    }
    if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.e(targetEntity.locX, targetEntity.getBoundingBox().b, targetEntity.locZ) >= 20) {
        return false;
    }
    this.targetEntity = targetEntity;
    return true;
}
Also used : EntityLiving(net.minecraft.server.v1_11_R1.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity) EntityArmorStand(net.minecraft.server.v1_11_R1.EntityArmorStand)

Example 9 with CraftLivingEntity

use of org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.

the class Sprint method shouldStart.

@Override
public boolean shouldStart() {
    if (!myPet.getSkills().isSkillActive(de.Keyle.MyPet.skill.skills.Sprint.class)) {
        return false;
    }
    if (petEntity.getMyPet().getDamage() <= 0) {
        return false;
    }
    if (!this.petEntity.hasTarget()) {
        return false;
    }
    EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
    if (!targetEntity.isAlive()) {
        return false;
    }
    if (lastTarget == targetEntity) {
        return false;
    }
    if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.h(targetEntity) >= 16) {
        return false;
    }
    this.lastTarget = targetEntity;
    return true;
}
Also used : EntityLiving(net.minecraft.server.v1_11_R1.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity)

Example 10 with CraftLivingEntity

use of org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.

the class MeleeAttack method shouldStart.

@Override
public boolean shouldStart() {
    if (myPet.getDamage() <= 0) {
        return false;
    }
    if (!this.petEntity.hasTarget()) {
        return false;
    }
    EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
    if (targetEntity instanceof EntityArmorStand) {
        return false;
    }
    if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.f(targetEntity.locX, targetEntity.getBoundingBox().b, targetEntity.locZ) >= 20) {
        return false;
    }
    this.targetEntity = targetEntity;
    return true;
}
Also used : EntityLiving(net.minecraft.server.v1_10_R1.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_10_R1.entity.CraftLivingEntity) EntityArmorStand(net.minecraft.server.v1_10_R1.EntityArmorStand)

Aggregations

EntityLiving (net.minecraft.server.v1_7_R4.EntityLiving)3 CraftLivingEntity (org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity)3 EntityLiving (net.minecraft.server.v1_10_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_8_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_8_R2.EntityLiving)2 EntityLiving (net.minecraft.server.v1_8_R3.EntityLiving)2 EntityLiving (net.minecraft.server.v1_9_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_9_R2.EntityLiving)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_10_R1.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_8_R1.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity)2 CraftLivingEntity (org.bukkit.craftbukkit.v1_9_R2.entity.CraftLivingEntity)2 EntityArmorStand (net.minecraft.server.v1_10_R1.EntityArmorStand)1 EntityArmorStand (net.minecraft.server.v1_11_R1.EntityArmorStand)1