本文整理汇总了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)
{
;
}
}
}
示例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();
}