Java 类net.minecraft.entity.projectile.EntityLlamaSpit 实例源码

项目:Backmemed    文件:RenderLlamaSpit.java   
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityLlamaSpit entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y + 0.15F, (float)z);
    GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
    this.bindEntityTexture(entity);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.field_191334_f.render(entity, partialTicks, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
项目:OpenBlocks    文件:LlamaBehavior.java   
@Override
public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) {
    final BlockPos pos = tile.getPos();
    final double pX = pos.getX() + 0.5;
    final double pY = pos.getY() + 1;
    final double pZ = pos.getZ() + 0.5;
    final World world = tile.getWorld();

    EntityLlamaSpit entityllamaspit = new EntityLlamaSpit(player.world);
    entityllamaspit.setPosition(pX, pY, pZ);

    double dX = player.posX - pX;
    double dy = player.getEntityBoundingBox().minY + player.height / 3.0F - entityllamaspit.posY;
    double dZ = player.posZ - pZ;
    float f = MathHelper.sqrt(dX * dX + dZ * dZ) * 0.2F;
    entityllamaspit.shoot(dX, dy + f, dZ, 1.5F, 10.0F);
    world.playSound((EntityPlayer)null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_LLAMA_SPIT, SoundCategory.NEUTRAL, 1.0F, 1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F);
    world.spawnEntity(entityllamaspit);

    return 0;
}
项目:Backmemed    文件:EntityLlama.java   
private void func_190713_e(EntityLivingBase p_190713_1_)
{
    EntityLlamaSpit entityllamaspit = new EntityLlamaSpit(this.world, this);
    double d0 = p_190713_1_.posX - this.posX;
    double d1 = p_190713_1_.getEntityBoundingBox().minY + (double)(p_190713_1_.height / 3.0F) - entityllamaspit.posY;
    double d2 = p_190713_1_.posZ - this.posZ;
    float f = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F;
    entityllamaspit.setThrowableHeading(d0, d1 + (double)f, d2, 1.5F, 10.0F);
    this.world.playSound((EntityPlayer)null, this.posX, this.posY, this.posZ, SoundEvents.field_191255_dF, this.getSoundCategory(), 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
    this.world.spawnEntityInWorld(entityllamaspit);
    this.field_190723_bJ = true;
}
项目:Backmemed    文件:RenderLlamaSpit.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityLlamaSpit entity)
{
    return field_191333_a;
}