Package vazkii.botania.common.block.tile.mana

Examples of vazkii.botania.common.block.tile.mana.TilePool


  public static int forceMeta = 0;
  public static boolean forceMana = false;

  @Override
  public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
    TilePool pool = (TilePool) tileentity;

    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    GL11.glTranslated(d0, d1, d2);
    boolean inf = tileentity.getWorldObj() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
    boolean dil = tileentity.getWorldObj() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;

    Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : dil ? textureDil : texture);

    GL11.glTranslatef(0.5F, 1.5F, 0.5F);
    GL11.glScalef(1F, -1F, -1F);
    int color = pool.color;
    float[] acolor = EntitySheep.fleeceColorTable[color];
    GL11.glColor3f(acolor[0], acolor[1], acolor[2]);
    model.render();
    GL11.glColor3f(1F, 1F, 1F);
    GL11.glScalef(1F, -1F, -1F);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);

    float waterLevel = (float) pool.getCurrentMana() / (float) pool.manaCap * 0.4F;
    if(forceMana)
      waterLevel = 0.4F;

    float s = 1F / 16F;
    float v = 1F / 8F;
    float w = -v * 3.5F;

    if(pool.getWorldObj() != null) {
      Block below = pool.getWorldObj().getBlock(pool.xCoord, pool.yCoord - 1, pool.zCoord);
      if(below instanceof IPoolOverlayProvider) {
        IIcon overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorldObj(), pool.xCoord, pool.yCoord - 1, pool.zCoord);
        if(overlay != null) {
          GL11.glPushMatrix();
          GL11.glEnable(GL11.GL_BLEND);
          GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
          GL11.glDisable(GL11.GL_ALPHA_TEST);
View Full Code Here


  public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glPushMatrix();
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    RenderTilePool.forceMeta = metadata;
    RenderTilePool.forceMana = RenderTilePool.forceMana | metadata == 1;
    TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePool(), 0.0D, 0.0D, 0.0D, 0.0F);
    GL11.glPopMatrix();
  }
View Full Code Here

        pylon.centerZ = zCoord;
      }

      tile = worldObj.getTileEntity(xCoord + pos[0], yCoord + pos[1] - 1, zCoord + pos[2]);
      if(tile instanceof TilePool) {
        TilePool pool = (TilePool) tile;
        if(pool.getCurrentMana() < cost)
          closeNow = true;
        else if(!worldObj.isRemote)
          pool.recieveMana(-cost);
      }
    }
  }
View Full Code Here

    return meta;
  }

  @Override
  public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
    TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4);
    lastFragile = pool.fragile;
    super.breakBlock(par1World, par2, par3, par4, par5, par6);
  }
View Full Code Here

    par3.add(new ItemStack(par1, 1, 1));
  }

  @Override
  public TileEntity createNewTileEntity(World world, int meta) {
    return new TilePool();
  }
View Full Code Here

  }

  @Override
  public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
    if(par5Entity instanceof EntityItem) {
      TilePool tile = (TilePool) par1World.getTileEntity(par2, par3, par4);
      if(tile.collideEntityItem((EntityItem) par5Entity))
        par1World.markBlockForUpdate(par2, par3, par4);
    }
  }
View Full Code Here

    return true;
  }

  @Override
  public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
    TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4);
    int val = (int) ((double) pool.getCurrentMana() / (double) pool.manaCap * 15.0);
    if(pool.getCurrentMana() > 0)
      val = Math.max(val, 1);

    return val;
  }
View Full Code Here

TOP

Related Classes of vazkii.botania.common.block.tile.mana.TilePool

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.