Package net.minecraft.client.renderer.texture

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


                setupSprite(i);
        }
       
        public void registerIcons(IIconRegister register)
        {
            TextureMap textureMap = (TextureMap)register;
           
            if(TextureUtils.refreshTexture(textureMap, resource.getResourcePath()))
            {
                reloadTexture();
                for(int i = 0; i < sprites.length; i++)
                    if(sprites[i] != null)
                        textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
            }
            else
            {
                for(int i : newSprites)
                    textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
            }
            newSprites.clear();
        }
View Full Code Here


    public static void bindAtlas(int atlasIndex) {
        engine().bindTexture(atlasIndex == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
    }

    public static IIcon getBlankIcon(int size, IIconRegister iconRegister) {
        TextureMap textureMap = (TextureMap) iconRegister;
        String s = "blank_" + size;
        if (textureMap.getTextureExtry(s) == null) {
            TextureSpecial icon = new TextureSpecial(s).blank(size);
            textureMap.setTextureEntry(s, icon);
        }
        return iconRegister.registerIcon(s);
    }
View Full Code Here

        }
        return iconRegister.registerIcon(s);
    }

    public static TextureSpecial getTextureSpecial(IIconRegister iconRegister, String name) {
        TextureMap textureMap = (TextureMap) iconRegister;
        IIcon entry = textureMap.getTextureExtry(name);
        if (entry != null)
            throw new IllegalStateException("Texture: " + name + " is already registered");

        TextureSpecial icon = new TextureSpecial(name);
        textureMap.setTextureEntry(name, icon);
        return icon;
    }
View Full Code Here

    engine().bindTexture(atlasIndex == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
  }

  public static IIcon getBlankIcon(int size, IIconRegister iconRegister) {

    TextureMap textureMap = (TextureMap) iconRegister;
    String s = "blank_" + size;
    if (textureMap.getTextureExtry(s) == null) {
      TextureSpecial icon = new TextureSpecial(s).blank(size);
      textureMap.setTextureEntry(s, icon);
    }
    return iconRegister.registerIcon(s);
  }
View Full Code Here

    return iconRegister.registerIcon(s);
  }

  public static TextureSpecial getTextureSpecial(IIconRegister iconRegister, String name) {

    TextureMap textureMap = (TextureMap) iconRegister;
    IIcon entry = textureMap.getTextureExtry(name);
    if (entry != null) {
      throw new IllegalStateException("Texture: " + name + " is already registered");
    }

    TextureSpecial icon = new TextureSpecial(name);
    textureMap.setTextureEntry(name, icon);
    return icon;
  }
View Full Code Here

    }

    @Override
    public void registerIcons(IIconRegister register) {

      TextureMap textureMap = (TextureMap) register;

      if (TextureUtils.refreshTexture(textureMap, resource.getResourcePath())) {
        reloadTexture();
        for (int i = 0; i < sprites.length; i++) {
          if (sprites[i] != null) {
            textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
          }
        }
      } else {
        for (int i : newSprites) {
          textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
        }
      }
      newSprites.clear();
    }
View Full Code Here

    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister register) {
        if (register instanceof TextureMap) { // should always be true (...but
            // you never know)
            TextureMap map = (TextureMap) register;
            for (int i = 0; i < 16; i++) {
                if (isValid(i)) {

                    // Registering custom icon classes

                    // name of custom icon ( must equal getIconName() )
                    String name = TextureOre.getDerivedName(entry[i].texture);
                    // see if there's already an icon of that name
                    TextureAtlasSprite texture = map.getTextureExtry(name);
                    if (texture == null) {
                        // if not create one and put it in the register
                        texture = new TextureOre(entry[i]);
                        map.setTextureEntry(name, texture);
                    }

                    icons[i] = map.getTextureExtry(name);
                }
            }
        }
    }
View Full Code Here

    public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int numIcons) {
        return unstitchIcons(iconRegister, name, numIcons, 1);
    }

    public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int columns, int rows) {
        TextureMap textureMap = (TextureMap) iconRegister;
        int numIcons = rows * columns;
        IIcon[] icons = new IIcon[numIcons];
        for (int i = 0; i < numIcons; i++) {
            String texName = name + "." + i;
            TextureAtlasSheet texture = new TextureAtlasSheet(texName, i, rows, columns);
            textureMap.setTextureEntry(texName, texture);
            icons[i] = texture;
        }
        return icons;
    }
View Full Code Here

  @SubscribeEvent
  @SideOnly(Side.CLIENT)
  public void loadTextures(TextureStitchEvent.Pre evt) {
    if (evt.map.getTextureType() == 0) {
      TextureMap terrainTextures = evt.map;
      FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
      FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
      FactoryProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraft:blockDrillHeadTexture");
    }
  }
View Full Code Here

                setupSprite(i);
        }
       
        public void registerIcons(IIconRegister register)
        {
            TextureMap textureMap = (TextureMap)register;
           
            if(TextureUtils.refreshTexture(textureMap, resource.getResourcePath()))
            {
                reloadTexture();
                for (TextureSpecial sprite : sprites)
                    if (sprite != null)
                        textureMap.setTextureEntry(sprite.getIconName(), sprite);
            }
            else
            {
                for(int i : newSprites)
                    textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
            }
            newSprites.clear();
        }
View Full Code Here

TOP

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

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.