Package net.minecraft.client.resources

Examples of net.minecraft.client.resources.IResource


        int w;

        AnimationMetadataSection animation;

        try {
            IResource iresource = manager.getResource(getBlockResource(name));
            IResource iresourceBase = manager.getResource(getBlockResource(base));

            // load the ore texture
            ore_image[0] = ImageIO.read(iresource.getInputStream());

            // load animation
            animation = (AnimationMetadataSection) iresource.getMetadata("animation");

            // load the stone texture
            stone_image = ImageIO.read(iresourceBase.getInputStream());

            w = ore_image[0].getWidth();

            if (stone_image.getWidth() != w) {
                List resourcePacks = manager.getAllResources(getBlockResource(base));
                for (int i = resourcePacks.size() - 1; i >= 0; --i) {
                    IResource resource = (IResource) resourcePacks.get(i);
                    stone_image = ImageIO.read(resource.getInputStream());

                    if (stone_image.getWidth() == w)
                        break;
                }
            }
View Full Code Here


    {
        this.fileName = resource.toString();

        try
        {
            IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resource);
            loadTechneModel(res.getInputStream());
        }
        catch (IOException e)
        {
            throw new ModelFormatException("IO Exception reading model format", e);
        }
View Full Code Here

    {
        this.fileName = resource.toString();
       
        try
        {
            IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resource);
            loadObjModel(res.getInputStream());
        }
        catch (IOException e)
        {
            throw new ModelFormatException("IO Exception reading model format", e);
        }
View Full Code Here

        if (split != -1)
            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath().substring(0, split));
        location = new ResourceLocation(location.getResourceDomain(), "textures/blocks/" + location.getResourcePath() + ".png");

        BufferedImage image;
        IResource resource = null;
        try {
            resource = manager.getResource(location);
            image = ImageIO.read(resource.getInputStream());
        } catch (IOException ex) {
            Game.log(Level.WARN, "Failed to load sub-texture from {0}: {1}", location.getResourcePath(), ex.getLocalizedMessage());
            return true;
        } finally {
            if (resource != null)
                try {
                    resource.getInputStream().close();
                } catch (IOException e) {
                }
        }

        Field mipmapLevel;
View Full Code Here

      {
        ResourceLocation resLoc = new ResourceLocation( Name );
        resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", "textures/blocks",
            resLoc.getResourcePath(), ".png" ) );

        IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
        if ( res != null )
          return new FlippableIcon( ir.registerIcon( Name ) );
      }
      catch (Throwable e)
      {
View Full Code Here

TOP

Related Classes of net.minecraft.client.resources.IResource

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.