当前位置: 首页>>代码示例>>Java>>正文


Java IResourcePack.getInputStream方法代码示例

本文整理汇总了Java中net.minecraft.client.resources.IResourcePack.getInputStream方法的典型用法代码示例。如果您正苦于以下问题:Java IResourcePack.getInputStream方法的具体用法?Java IResourcePack.getInputStream怎么用?Java IResourcePack.getInputStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.resources.IResourcePack的用法示例。


在下文中一共展示了IResourcePack.getInputStream方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadResources

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static void loadResources(IResourcePack p_loadResources_0_, String[] p_loadResources_1_, Map p_loadResources_2_)
{
    try
    {
        for (int i = 0; i < p_loadResources_1_.length; ++i)
        {
            String s = p_loadResources_1_[i];
            ResourceLocation resourcelocation = new ResourceLocation(s);

            if (p_loadResources_0_.resourceExists(resourcelocation))
            {
                InputStream inputstream = p_loadResources_0_.getInputStream(resourcelocation);

                if (inputstream != null)
                {
                    loadLocaleData(inputstream, p_loadResources_2_);
                }
            }
        }
    }
    catch (IOException ioexception)
    {
        ioexception.printStackTrace();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:Lang.java

示例2: getBedrockImage

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static BufferedImage getBedrockImage() {
    if (TConTextureResourcePackBedrockium.bedrockImage == null) {
        final ResourceLocation bedrockLocation = new ResourceLocation("minecraft", "textures/blocks/bedrock.png");
        try {
            final DefaultResourcePack mcDefaultResourcePack = (DefaultResourcePack)ObfuscationReflectionHelper.getPrivateValue((Class)Minecraft.class, (Object)Minecraft.getMinecraft(), new String[] { "field_110450_ap", "mcDefaultResourcePack" });
            InputStream inputStream = mcDefaultResourcePack.getInputStream(bedrockLocation);
            final List<ResourcePackRepository.Entry> t = (List<ResourcePackRepository.Entry>)Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries();
            for (final ResourcePackRepository.Entry entry : t) {
                final IResourcePack resourcePack = entry.getResourcePack();
                if (resourcePack.resourceExists(bedrockLocation)) {
                    inputStream = resourcePack.getInputStream(bedrockLocation);
                }
            }
            TConTextureResourcePackBedrockium.bedrockImage = ImageIO.read(inputStream);
        }
        catch (IOException e) {
            throw Throwables.propagate((Throwable)e);
        }
    }
    return TConTextureResourcePackBedrockium.bedrockImage;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:22,代码来源:TConTextureResourcePackBedrockium.java

示例3: getStream

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public InputStream getStream(final ResourceLocation location) {
    InputStream stream = null;
    for (final IResourcePack iResourcePack : this.getPacks()) {
        if (iResourcePack.resourceExists(location)) {
            try {
                stream = iResourcePack.getInputStream(location);
            }
            catch (IOException ex) {}
        }
    }
    return stream;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:13,代码来源:TConTextureResourcePackBase.java

示例4: getTextureAnimations

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static TextureAnimation[] getTextureAnimations(IResourcePack p_getTextureAnimations_0_)
{
    String[] astring = ResUtils.collectFiles(p_getTextureAnimations_0_, (String)"mcpatcher/anim", (String)".properties", (String[])null);

    if (astring.length <= 0)
    {
        return null;
    }
    else
    {
        List list = new ArrayList();

        for (int i = 0; i < astring.length; ++i)
        {
            String s = astring[i];
            Config.dbg("Texture animation: " + s);

            try
            {
                ResourceLocation resourcelocation = new ResourceLocation(s);
                InputStream inputstream = p_getTextureAnimations_0_.getInputStream(resourcelocation);
                Properties properties = new Properties();
                properties.load(inputstream);
                TextureAnimation textureanimation = makeTextureAnimation(properties, resourcelocation);

                if (textureanimation != null)
                {
                    ResourceLocation resourcelocation1 = new ResourceLocation(textureanimation.getDstTex());

                    if (Config.getDefiningResourcePack(resourcelocation1) != p_getTextureAnimations_0_)
                    {
                        Config.dbg("Skipped: " + s + ", target texture not loaded from same resource pack");
                    }
                    else
                    {
                        list.add(textureanimation);
                    }
                }
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                Config.warn("File not found: " + filenotfoundexception.getMessage());
            }
            catch (IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }

        TextureAnimation[] atextureanimation = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()]));
        return atextureanimation;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:54,代码来源:TextureAnimations.java

示例5: updateIcons

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap p_updateIcons_0_, IResourcePack p_updateIcons_1_)
{
    String[] astring = ResUtils.collectFiles(p_updateIcons_1_, "mcpatcher/ctm/", ".properties", getDefaultCtmPaths());
    Arrays.sort((Object[])astring);
    List list = makePropertyList(tileProperties);
    List list1 = makePropertyList(blockProperties);

    for (int i = 0; i < astring.length; ++i)
    {
        String s = astring[i];
        Config.dbg("ConnectedTextures: " + s);

        try
        {
            ResourceLocation resourcelocation = new ResourceLocation(s);
            InputStream inputstream = p_updateIcons_1_.getInputStream(resourcelocation);

            if (inputstream == null)
            {
                Config.warn("ConnectedTextures file not found: " + s);
            }
            else
            {
                Properties properties = new Properties();
                properties.load(inputstream);
                ConnectedProperties connectedproperties = new ConnectedProperties(properties, s);

                if (connectedproperties.isValid(s))
                {
                    connectedproperties.updateIcons(p_updateIcons_0_);
                    addToTileList(connectedproperties, list);
                    addToBlockList(connectedproperties, list1);
                }
            }
        }
        catch (FileNotFoundException var11)
        {
            Config.warn("ConnectedTextures file not found: " + s);
        }
        catch (Exception exception)
        {
            exception.printStackTrace();
        }
    }

    blockProperties = propertyListToArray(list1);
    tileProperties = propertyListToArray(list);
    multipass = detectMultipass();
    Config.dbg("Multipass connected textures: " + multipass);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:51,代码来源:ConnectedTextures.java

示例6: updateIcons

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap p_updateIcons_0_, IResourcePack p_updateIcons_1_)
{
    String[] astring = collectFiles(p_updateIcons_1_, "mcpatcher/ctm/", ".properties");
    Arrays.sort((Object[])astring);
    List list = makePropertyList(tileProperties);
    List list1 = makePropertyList(blockProperties);

    for (int i = 0; i < astring.length; ++i)
    {
        String s = astring[i];
        Config.dbg("ConnectedTextures: " + s);

        try
        {
            ResourceLocation resourcelocation = new ResourceLocation(s);
            InputStream inputstream = p_updateIcons_1_.getInputStream(resourcelocation);

            if (inputstream == null)
            {
                Config.warn("ConnectedTextures file not found: " + s);
            }
            else
            {
                Properties properties = new Properties();
                properties.load(inputstream);
                ConnectedProperties connectedproperties = new ConnectedProperties(properties, s);

                if (connectedproperties.isValid(s))
                {
                    connectedproperties.updateIcons(p_updateIcons_0_);
                    addToTileList(connectedproperties, list);
                    addToBlockList(connectedproperties, list1);
                }
            }
        }
        catch (FileNotFoundException var11)
        {
            Config.warn("ConnectedTextures file not found: " + s);
        }
        catch (IOException ioexception)
        {
            ioexception.printStackTrace();
        }
    }

    blockProperties = propertyListToArray(list1);
    tileProperties = propertyListToArray(list);
    multipass = detectMultipass();
    Config.dbg("Multipass connected textures: " + multipass);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:51,代码来源:ConnectedTextures.java

示例7: getTextureAnimations

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static TextureAnimation[] getTextureAnimations(IResourcePack p_getTextureAnimations_0_)
{
    String[] astring = ResUtils.collectFiles(p_getTextureAnimations_0_, (String)"mcpatcher/anim/", (String)".properties", (String[])null);

    if (astring.length <= 0)
    {
        return null;
    }
    else
    {
        List list = new ArrayList();

        for (int i = 0; i < astring.length; ++i)
        {
            String s = astring[i];
            Config.dbg("Texture animation: " + s);

            try
            {
                ResourceLocation resourcelocation = new ResourceLocation(s);
                InputStream inputstream = p_getTextureAnimations_0_.getInputStream(resourcelocation);
                Properties properties = new Properties();
                properties.load(inputstream);
                TextureAnimation textureanimation = makeTextureAnimation(properties, resourcelocation);

                if (textureanimation != null)
                {
                    ResourceLocation resourcelocation1 = new ResourceLocation(textureanimation.getDstTex());

                    if (Config.getDefiningResourcePack(resourcelocation1) != p_getTextureAnimations_0_)
                    {
                        Config.dbg("Skipped: " + s + ", target texture not loaded from same resource pack");
                    }
                    else
                    {
                        list.add(textureanimation);
                    }
                }
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                Config.warn("File not found: " + filenotfoundexception.getMessage());
            }
            catch (IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }

        TextureAnimation[] atextureanimation = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()]));
        return atextureanimation;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:54,代码来源:TextureAnimations.java

示例8: openPackDescriptor

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openPackDescriptor(@Nonnull final IResourcePack pack) throws IOException {
	return pack.getInputStream(this.manifest);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:ResourcePacks.java

示例9: openAcoustics

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openAcoustics(@Nonnull final IResourcePack pack) throws IOException {
	return pack.getInputStream(this.acoustics);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:ResourcePacks.java

示例10: openPrimitiveMap

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openPrimitiveMap(@Nonnull final IResourcePack pack) throws IOException {
	return pack.getInputStream(this.primitivemap);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:ResourcePacks.java

示例11: openScript

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private InputStream openScript(@Nonnull final IResourcePack pack) throws IOException {
	return pack.getInputStream(SCRIPT);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:RegistryManager.java

示例12: updateIcons

import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap textureMap, IResourcePack rp)
{
    String[] names = collectFiles(rp, "mcpatcher/ctm/", ".properties");
    Arrays.sort(names);
    List tileList = makePropertyList(tileProperties);
    List blockList = makePropertyList(blockProperties);

    for (int i = 0; i < names.length; ++i)
    {
        String name = names[i];
        Config.dbg("ConnectedTextures: " + name);

        try
        {
            ResourceLocation e = new ResourceLocation(name);
            InputStream in = rp.getInputStream(e);

            if (in == null)
            {
                Config.warn("ConnectedTextures file not found: " + name);
            }
            else
            {
                Properties props = new Properties();
                props.load(in);
                ConnectedProperties cp = new ConnectedProperties(props, name);

                if (cp.isValid(name))
                {
                    cp.updateIcons(textureMap);
                    addToTileList(cp, tileList);
                    addToBlockList(cp, blockList);
                }
            }
        }
        catch (FileNotFoundException var11)
        {
            Config.warn("ConnectedTextures file not found: " + name);
        }
        catch (IOException var12)
        {
            var12.printStackTrace();
        }
    }

    blockProperties = propertyListToArray(blockList);
    tileProperties = propertyListToArray(tileList);
    multipass = detectMultipass();
    Config.dbg("Multipass connected textures: " + multipass);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:51,代码来源:ConnectedTextures.java


注:本文中的net.minecraft.client.resources.IResourcePack.getInputStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。