Search in sources :

Example 1 with EntityPegasusMount

use of de.sanandrew.mods.claysoldiers.entity.mount.EntityPegasusMount in project ClaySoldiersMod by SanAndreasP.

the class ItemHorseDoll method spawnHorse.

/**
 * Spawns the horse specified by the type in the location specified by the last three parameters.
 *
 * @param world the World the entity will spawn in
 * @param type  the type the horse will be
 */
public static EntityHorseMount spawnHorse(World world, EnumHorseType type, boolean isPegasus, double x, double y, double z) {
    EntityHorseMount jordan;
    if (isPegasus) {
        jordan = new EntityPegasusMount(world, type);
    } else {
        jordan = new EntityHorseMount(world, type);
    }
    jordan.setLocationAndAngles(x, y, z, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F);
    jordan.rotationYawHead = jordan.rotationYaw;
    jordan.renderYawOffset = jordan.rotationYaw;
    world.spawnEntityInWorld(jordan);
    jordan.playSound("step.gravel", 1.0F, 1.0F);
    return jordan;
}
Also used : EntityHorseMount(de.sanandrew.mods.claysoldiers.entity.mount.EntityHorseMount) EntityPegasusMount(de.sanandrew.mods.claysoldiers.entity.mount.EntityPegasusMount)

Example 2 with EntityPegasusMount

use of de.sanandrew.mods.claysoldiers.entity.mount.EntityPegasusMount in project ClaySoldiersMod by SanAndreasP.

the class ModelPegasusMount method render.

@Override
public void render(Entity entity, float limbSwing, float limbSwingAmount, float rotFloat, float rotYaw, float rotPitch, float partTicks) {
    EntityPegasusMount pegasus = (EntityPegasusMount) entity;
    this.isOnGround = pegasus.onGround;
    this.wingSwingAmount = (pegasus.wingSwingStep + (pegasus.wingSwing - pegasus.prevWingSwing) * partTicks);
    pegasus.wingSwingStep = this.wingSwingAmount;
    super.render(entity, limbSwing, limbSwingAmount, rotFloat, rotYaw, rotPitch, partTicks);
    this.wingLeft.render(partTicks);
    this.wingRight.render(partTicks);
}
Also used : EntityPegasusMount(de.sanandrew.mods.claysoldiers.entity.mount.EntityPegasusMount)

Aggregations

EntityPegasusMount (de.sanandrew.mods.claysoldiers.entity.mount.EntityPegasusMount)2 EntityHorseMount (de.sanandrew.mods.claysoldiers.entity.mount.EntityHorseMount)1