Search in sources :

Example 31 with EntitySize

use of de.Keyle.MyPet.api.entity.EntitySize in project MyPet by xXKeyleXx.

the class EntityMyPhantom method getDimensions.

@Override
public net.minecraft.world.entity.EntityDimensions getDimensions(Pose entitypose) {
    EntitySize es = this.getClass().getAnnotation(EntitySize.class);
    if (es != null) {
        int size = Math.max(1, getMyPet().getSize());
        float width = es.width();
        float height = Float.isNaN(es.height()) ? width : es.height();
        return new net.minecraft.world.entity.EntityDimensions(width * size, height * size, false);
    }
    return super.getDimensions(entitypose);
}
Also used : EntitySize(de.Keyle.MyPet.api.entity.EntitySize)

Example 32 with EntitySize

use of de.Keyle.MyPet.api.entity.EntitySize in project MyPet by xXKeyleXx.

the class EntityMySlime method getDimensions.

@Override
public net.minecraft.world.entity.EntityDimensions getDimensions(Pose entitypose) {
    EntitySize es = this.getClass().getAnnotation(EntitySize.class);
    if (es != null) {
        int size = Math.max(1, getMyPet().getSize());
        float width = es.width();
        float height = Float.isNaN(es.height()) ? width : es.height();
        return new net.minecraft.world.entity.EntityDimensions(width * size, height * size, false);
    }
    return super.getDimensions(entitypose);
}
Also used : EntitySize(de.Keyle.MyPet.api.entity.EntitySize)

Aggregations

EntitySize (de.Keyle.MyPet.api.entity.EntitySize)32 MeleeAttack (de.Keyle.MyPet.compat.v1_10_R1.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_11_R1.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_12_R1.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_7_R4.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_8_R1.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_8_R2.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_8_R3.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_9_R1.entity.ai.attack.MeleeAttack)2 MeleeAttack (de.Keyle.MyPet.compat.v1_9_R2.entity.ai.attack.MeleeAttack)2