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


Java IResourceManager.getAllResources方法代码示例

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


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

示例1: onResourceManagerReload

import net.minecraft.client.resources.IResourceManager; //导入方法依赖的package包/类
public void onResourceManagerReload(IResourceManager resourceManager)
{
    this.sndManager.reloadSoundSystem();
    this.sndRegistry.clearMap();

    for (String s : resourceManager.getResourceDomains())
    {
        try
        {
            for (IResource iresource : resourceManager.getAllResources(new ResourceLocation(s, "sounds.json")))
            {
                try
                {
                    Map<String, SoundList> map = this.getSoundMap(iresource.getInputStream());

                    for (Entry<String, SoundList> entry : map.entrySet())
                    {
                        this.loadSoundResource(new ResourceLocation(s, (String)entry.getKey()), (SoundList)entry.getValue());
                    }
                }
                catch (RuntimeException runtimeexception)
                {
                    logger.warn((String)"Invalid sounds.json", (Throwable)runtimeexception);
                }
            }
        }
        catch (IOException var11)
        {
            ;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:SoundHandler.java

示例2: onResourceManagerReload

import net.minecraft.client.resources.IResourceManager; //导入方法依赖的package包/类
public void onResourceManagerReload(IResourceManager resourceManager)
{
    this.soundRegistry.clearMap();

    for (String s : resourceManager.getResourceDomains())
    {
        try
        {
            for (IResource iresource : resourceManager.getAllResources(new ResourceLocation(s, "sounds.json")))
            {
                try
                {
                    Map<String, SoundList> map = this.getSoundMap(iresource.getInputStream());

                    for (Entry<String, SoundList> entry : map.entrySet())
                    {
                        this.loadSoundResource(new ResourceLocation(s, (String)entry.getKey()), (SoundList)entry.getValue());
                    }
                }
                catch (RuntimeException runtimeexception)
                {
                    LOGGER.warn((String)"Invalid sounds.json", (Throwable)runtimeexception);
                }
            }
        }
        catch (IOException var11)
        {
            ;
        }
    }

    for (ResourceLocation resourcelocation : this.soundRegistry.getKeys())
    {
        SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.soundRegistry.getObject(resourcelocation);

        if (soundeventaccessor.getSubtitle() instanceof TextComponentTranslation)
        {
            String s1 = ((TextComponentTranslation)soundeventaccessor.getSubtitle()).getKey();

            if (!I18n.hasKey(s1))
            {
                LOGGER.debug("Missing subtitle {} for event: {}", new Object[] {s1, resourcelocation});
            }
        }
    }

    for (ResourceLocation resourcelocation1 : this.soundRegistry.getKeys())
    {
        if (SoundEvent.REGISTRY.getObject(resourcelocation1) == null)
        {
            LOGGER.debug("Not having sound event for: {}", new Object[] {resourcelocation1});
        }
    }

    this.sndManager.reloadSoundSystem();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:57,代码来源:SoundHandler.java


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