Package vazkii.botania.common.entity

Examples of vazkii.botania.common.entity.EntitySpark


public class RenderSpark extends RenderEntity {

  @Override
  public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    EntitySpark spark = (EntitySpark) par1Entity;
    IIcon iicon = ItemSpark.worldIcon;

    GL11.glPushMatrix();
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.05F);

    double time = ClientTickHandler.ticksInGame + par9;
    time += new Random(par1Entity.getEntityId()).nextInt();
    GL11.glColor4f(1F, 1F, 1F, 0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2);

    float scale = 0.75F + 0.1F * (float) Math.sin(time / 10);
    GL11.glScalef(scale, scale, scale);
    bindEntityTexture(par1Entity);
    Tessellator tessellator = Tessellator.instance;

    float r = 180.0F - renderManager.playerViewY;
    GL11.glRotatef(r, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-renderManager.playerViewX, 1F, 0F, 0F);
    func_77026_a(tessellator, iicon);
    int upgrade = spark.getUpgrade() - 1;
    if(upgrade >= 0 && upgrade < ItemSparkUpgrade.worldIcons.length) {
      GL11.glTranslatef(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F);
      GL11.glScalef(0.2F, 0.2F, 0.2F);
      func_77026_a(tessellator, ItemSparkUpgrade.worldIcons[upgrade]);
    }
View Full Code Here


    if(tile instanceof ISparkAttachable) {
      ISparkAttachable attach = (ISparkAttachable) tile;
      if(attach.canAttachSpark(stack) && attach.getAttachedSpark() == null) {
        stack.stackSize--;
        if(!world.isRemote) {
          EntitySpark spark = new EntitySpark(world);
          spark.setPosition(x + 0.5, y + 1.5, z + 0.5);
          world.spawnEntityInWorld(spark);
          attach.attachSpark(spark);
          world.markBlockForUpdate(x, y, z);
        }
        return true;
View Full Code Here

TOP

Related Classes of vazkii.botania.common.entity.EntitySpark

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.