@Override
  public void renderTileEntityAt(
      TileEntity tileentity, double x, double y, double z, float partialTicks) {
    TileEntityBambooMug mug = (TileEntityBambooMug) tileentity;
    TropicraftUtils.bindTextureTE("bamboomug");
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
    GL11.glRotatef(180f, 1f, 0f, 1f);
    int meta = mug.getMetadata();

    if (meta == 2) {
      GL11.glRotatef(0f, 0f, 1f, 0f);
    } else if (meta == 3) {
      GL11.glRotatef(180f, 0f, 1f, 0f);
    } else if (meta == 4) {
      GL11.glRotatef(270f, 0f, 1f, 0f);
    } else if (meta == 5) {
      GL11.glRotatef(90f, 0f, 1f, 0f);
    }

    if (!mug.isEmpty()) {
      modelBambooMug.renderLiquid = true;
      modelBambooMug.liquidColor = ItemCocktail.getCocktailColor(mug.cocktail);
    } else {
      modelBambooMug.renderLiquid = false;
    }

    modelBambooMug.renderBambooMug();

    if (!mug.isEmpty()) {
      Drink drink = ItemCocktail.getDrink(mug.cocktail);
      if (drink != null && drink.hasUmbrella) {
        GL11.glTranslatef(0f, 1.175f, 0f);
        GL11.glRotatef(30f, 1f, 0f, 1f);
        GL11.glScalef(0.25f, 0.25f, 0.25f);
        TropicraftUtils.bindTextureEntity("beachstuff/umbrellatextred");
        modelUmbrella.renderUmbrella();
      }
    }

    GL11.glPopMatrix();
  }
Ejemplo n.º 2
0
  @Override
  @SideOnly(Side.CLIENT)
  public void renderHelmetOverlay(
      ItemStack stack,
      EntityPlayer player,
      ScaledResolution resolution,
      float partialTicks,
      boolean hasScreen,
      int mouseX,
      int mouseY) {
    int i = resolution.getScaledWidth();
    int j = resolution.getScaledHeight();
    GL11.glDisable(2929 /*
		 * GL_DEPTH_TEST
		 */);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(3008 /*
		 * GL_ALPHA_TEST
		 */);
    /*	TODO	GL11.glBindTexture(3553
    		 * GL_TEXTURE_2D
    		 , Minecraft.getMinecraft().renderEngine
    .getTexture("%blur%/tropicalmod/gui/snorkelGrad.png"));*/

    TropicraftUtils.bindTextureModGui("snorkelGrad");
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D);
    tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D);
    tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D);
    tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D);
    tessellator.draw();
    GL11.glDepthMask(true);
    GL11.glEnable(2929 /*
		 * GL_DEPTH_TEST
		 */);
    GL11.glEnable(3008 /*
		 * GL_ALPHA_TEST
		 */);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  }