Java Code Examples for net.minecraft.entity.projectile.EntityLlamaSpit

The following are top voted examples for showing how to use net.minecraft.entity.projectile.EntityLlamaSpit. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Backmemed   File: RenderLlamaSpit.java   Source Code and License 6 votes vote down vote up
/**
 * 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);
}
 
Example 2
Project: OpenBlocks   File: LlamaBehavior.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 3
Project: Backmemed   File: EntityLlama.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 4
Project: Backmemed   File: RenderLlamaSpit.java   Source Code and License 4 votes vote down vote up
/**
 * 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;
}