Examples of TextureManager


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

 
  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

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

 
    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

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

   
    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

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

 
  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

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

   
    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

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

   * @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

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

        if (icon == null)
        {
            GL11.glPopMatrix();
            return;
        }
        TextureManager texturemanager = this.mc.getTextureManager();
        texturemanager.bindTexture(texturemanager.getResourceLocation(stack.getItemSpriteNumber()));

        if (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
        {
            GL11.glTranslatef(0.6F, 0.5F, 0.5F);
        }
View Full Code Here

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

        if (icon == null)
        {
            GL11.glPopMatrix();
            return;
        }
        TextureManager texturemanager = Minecraft.getMinecraft().renderEngine;
        texturemanager.bindTexture(texturemanager.getResourceLocation(par1ItemStack.getItemSpriteNumber()));
        Tessellator tessellator = Tessellator.instance;
        float f = icon.getMinU();
        float f1 = icon.getMaxU();
        float f2 = icon.getMinV();
        float f3 = icon.getMaxV();
View Full Code Here

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

                int shifty = 35;
                String logoFile = selectedMod.getMetadata().logoFile;
                if (!logoFile.isEmpty())
                {
                    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                    TextureManager tm = mc.getTextureManager();
                    IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId());
                    try
                    {
                        if (cachedLogo == null)
                        {
                            BufferedImage logo = null;
                            if (pack!=null)
                            {
                                logo = pack.getPackImage();
                            }
                            else
                            {
                                InputStream logoResource = getClass().getResourceAsStream(logoFile);
                                if (logoResource != null)
                                {
                                    logo = ImageIO.read(logoResource);
                                }
                            }
                            if (logo != null)
                            {
                                cachedLogo = tm.getDynamicTextureLocation("modlogo", new DynamicTexture(logo));
                                cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight());
                            }
                        }
                        if (cachedLogo != null)
                        {
View Full Code Here

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

        ticksExisted++;
    }

    public void render(float partialTicks, double x1, double y1, double z1, double x2, double y2, double z2){
        Minecraft mc = FMLClientHandler.instance().getClient();
        TextureManager textureManager = mc.renderEngine;

        double laserLength = PneumaticCraftUtils.distBetween(x1, y1, z1, x2, y2, z2);
        double laserSize = 0.4;

        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

        GL11.glTranslated(x1, y1, z1);

        double dx = x2 - x1;
        double dy = y2 - y1;
        double dz = z2 - z1;
        float f3 = MathHelper.sqrt_double(dx * dx + dz * dz);
        double rotYaw = Math.atan2(dx, dz) * 180.0D / Math.PI;
        double rotPitch = 90 - (float)(Math.atan2(dy, f3) * 180.0D / Math.PI);

        GL11.glRotated(rotYaw, 0, 1, 0);
        GL11.glRotated(rotPitch, 1, 0, 0);

        GL11.glScaled(laserSize, laserSize, laserSize);
        GL11.glTranslated(0, 0.6, 0);
        GL11.glRotated((ticksExisted + partialTicks) * 200, 0, 1, 0);

        GL11.glPushMatrix();
        GL11.glScaled(1, laserLength / laserSize, 1);

        /*   GL11.glTranslated(0, -0.01, 0);
           textureManager.bindTexture(Textures.RENDER_LASER_ANIMATION);
           renderAnimation(partialTicks, laserLength / laserSize);
           GL11.glTranslated(0, 0.01, 0);*/

        textureManager.bindTexture(Textures.RENDER_LASER);
        renderQuad(glowColor);
        textureManager.bindTexture(Textures.RENDER_LASER_OVERLAY);
        renderQuad(coreColor);
        GL11.glPopMatrix();

        GL11.glRotated(180, 1, 0, 0);
        textureManager.bindTexture(Textures.RENDER_LASER_START);
        renderQuad(glowColor);
        textureManager.bindTexture(Textures.RENDER_LASER_START_OVERLAY);
        renderQuad(coreColor);

        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_LIGHTING);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.