Package net.minecraft.client.renderer.texture

Examples of net.minecraft.client.renderer.texture.TextureManager


    if(data[dataIndex] instanceof FluidStack)
    {
      FluidStack liquid = (FluidStack)data[dataIndex];

      TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

      Fluid fluid = liquid.getFluid();
      IIcon icon = fluid.getStillIcon();

      if(icon != null)
      {
        textureManager.bindTexture(TextureMap.locationBlocksTexture);

                double u = icon.getInterpolatedU(3.0);
                double u2 = icon.getInterpolatedU(13.0);
                double v = icon.getInterpolatedV(1.0);
                double v2 = icon.getInterpolatedV(15.0);
View Full Code Here


  @Override
  public void draw(Renderer renderer, int x, int y)
  {
    if(liquid != null)
    {
      TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

      Fluid fluid = liquid.getFluid();
      IIcon icon = fluid.getStillIcon();

      if(icon != null)
      {
        textureManager.bindTexture(TextureMap.locationBlocksTexture);

                double u = icon.getInterpolatedU(3.0);
                double u2 = icon.getInterpolatedU(13.0);
                double v = icon.getInterpolatedV(1.0);
                double v2 = icon.getInterpolatedV(15.0);
View Full Code Here

                model.render(entityEquipped, 1, false, colour, glow);
                break;
            case FIRST_PERSON_MAP:
                EntityPlayer playerFirstPerson = (EntityPlayer) data[0];
                TextureManager engineFirstPerson = (TextureManager) data[1];
                MapData mapDataFirstPerson = (MapData) data[2];
                model.setPoseForPlayer(playerFirstPerson, itemStack);

                model.render(playerFirstPerson, 1, true, colour, glow);
                break;
View Full Code Here

  {
    if(useLegacyCompiler)
      GL11.glCallList(displayList);
    else
    {
      TextureManager renderEngine = RenderManager.instance.renderEngine;
     
      Collection<TextureGroup> textures = textureGroup.values();
     
      Iterator<TextureGroup> itr = textures.iterator();
      for(int i = 0; itr.hasNext(); i++)
      {
        TextureGroup curTexGroup = itr.next();
        curTexGroup.loadTexture();
        GL11.glCallList(displayListArray[i]);
        if(!defaultTexture.equals(""))
          renderEngine.bindTexture(new ResourceLocation("", defaultTexture)); //TODO : Check. Not sure about this one
      }
    }
  }
View Full Code Here

 
  public void loadTexture(int defaultTexture)
  {
    if(!texture.equals(""))
    {
      TextureManager renderengine = RenderManager.instance.renderEngine;
      renderengine.bindTexture(new ResourceLocation("", texture)); //TODO : Check. Not sure about this one
    }
    else if(defaultTexture > -1)
    {
      RenderManager.instance.renderEngine.bindTexture(new ResourceLocation("", ""));
    }
View Full Code Here

 
    private void renderItem(EntityMecha mecha, ItemStack stack, int par3, boolean leftHand, float dT)
    {
        GL11.glPushMatrix();
        TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
    Item item = stack.getItem();
   
    //Render tools
    if(item instanceof ItemMechaAddon)
    {

      GL11.glRotatef(-90F, 0F, 0F, 1F);
      GL11.glTranslatef(0F, 0F, 0F);
      ItemMechaAddon toolItem = (ItemMechaAddon)item;
      MechaItemType toolType = toolItem.type;
      bindTexture(FlansModResourceHandler.getTexture(toolType));
      if(toolType.model != null)
      {
        toolType.model.render(mecha, dT);
            GL11.glPushMatrix();
        if((leftHand && mecha.leftMouseHeld) || (!leftHand && mecha.rightMouseHeld))
        {
          GL11.glRotatef(25F * (float)mecha.ticksExisted, 1F, 0F, 0F);
        }
        toolType.model.renderDrill(mecha, dT);
        GL11.glPopMatrix();
        toolType.model.renderSaw(mecha, dT, (leftHand && mecha.leftMouseHeld) || (!leftHand && mecha.rightMouseHeld));
      }
    }
    else if(item instanceof ItemGun && ((ItemGun)item).type.model != null)
    {
      GunType gunType = ((ItemGun)item).type;
      ModelGun model = gunType.model;
     
      GL11.glRotatef(-90F, 0F, 0F, 1F);
      texturemanager.bindTexture(FlansModResourceHandler.getTexture(gunType));
      ClientProxy.gunRenderer.renderGun(stack, gunType, 1F / 16F, model, leftHand ? mecha.leftAnimations : mecha.rightAnimations, 0F);
    }
    else
    {
          IIcon icon = stack.getIconIndex();
          if (icon == null)
          {
              GL11.glPopMatrix();
              return;
          }
 
          texturemanager.bindTexture(texturemanager.getResourceLocation(stack.getItemSpriteNumber()));
          Tessellator tessellator = Tessellator.instance;
          float f = icon.getMinU();
          float f1 = icon.getMaxU();
          float f2 = icon.getMinV();
          float f3 = icon.getMaxV();
          float f4 = 0.0F;
          float f5 = 0.3F;
          GL11.glEnable(GL12.GL_RESCALE_NORMAL);
          GL11.glTranslatef(-f4, -f5, 0.0F);
          float f6 = 1.5F;
          GL11.glScalef(f6, f6, f6);
          GL11.glTranslatef(0.2F, 0.7F, 0.0F);
          GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-133.0F, 0.0F, 0.0F, 1.0F);
         
          renderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
 
          if (stack.hasEffect(par3))
          {
              GL11.glDepthFunc(GL11.GL_EQUAL);
              GL11.glDisable(GL11.GL_LIGHTING);
              texturemanager.bindTexture(RES_ITEM_GLINT);
              GL11.glEnable(GL11.GL_BLEND);
              GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
              float f7 = 0.76F;
              GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
              GL11.glMatrixMode(GL11.GL_TEXTURE);
View Full Code Here

   
    Item item = stack.getItem();
    if (!(item instanceof ItemArmor)) return -1;
   
    ItemArmor itemarmor = (ItemArmor)item;
    TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
    textureManager.bindTexture(RenderBiped.getArmorResource(entity, stack, slot, null));
   
    ModelBiped modelBiped = ForgeHooksClient.getArmorModel(entity, stack, slot, null);
    setRenderPassModel(modelBiped);
    if (modelBiped != null) {
      modelBiped.onGround = mainModel.onGround;
View Full Code Here

 
  private RenderUtils() {  }
 
  public static void renderItemIn3d(ItemStack stack) {
   
    TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
    // Not sure why but this can be null when the world loads.
    if (textureManager == null) return;
    Item item = stack.getItem();
   
    GL11.glPushMatrix();
   
    Tessellator tessellator = Tessellator.instance;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslatef(-0.5F, -0.5F, 1 / 32.0F);
   
    int passes = item.getRenderPasses(stack.getItemDamage());
    for (int pass = 0; pass < passes; pass++) {
      textureManager.bindTexture(((stack.getItemSpriteNumber() == 0) ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture));
      IIcon icon = item.getIcon(stack, pass);
      float minU = icon.getMinU();
      float maxU = icon.getMaxU();
      float minV = icon.getMinV();
      float maxV = icon.getMaxV();
      RenderUtils.setColorFromInt(item.getColorFromItemStack(stack, pass));
      ItemRenderer.renderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
    }
   
    if (stack.hasEffect(0)) {
      GL11.glDepthFunc(GL11.GL_EQUAL);
      GL11.glDisable(GL11.GL_LIGHTING);
      textureManager.bindTexture(glint);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
      float f7 = 0.76F;
      GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
      GL11.glMatrixMode(GL11.GL_TEXTURE);
View Full Code Here

   
    return targetOrientation.getOpposite() == direction;
  }

  private void bindTexture(ResourceLocation p_147499_1_) {
    TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e;
    if(texturemanager != null) {
      texturemanager.bindTexture(p_147499_1_);
    }
  }
View Full Code Here

   * @param par3IImageBuffer
   * @return
   */
  public static ThreadDownloadImageData makeDownloadThread(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer)
  {
    TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();

    TextureObject object = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer);
    // Binds ResourceLocation to this.
    texturemanager.loadTexture(par0ResourceLocation, object);

    return (ThreadDownloadImageData)object;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.client.renderer.texture.TextureManager

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.