本文整理汇总了Java中net.minecraft.client.resources.IResourcePack.resourceExists方法的典型用法代码示例。如果您正苦于以下问题:Java IResourcePack.resourceExists方法的具体用法?Java IResourcePack.resourceExists怎么用?Java IResourcePack.resourceExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.resources.IResourcePack
的用法示例。
在下文中一共展示了IResourcePack.resourceExists方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectFilesFixed
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static String[] collectFilesFixed(IResourcePack p_collectFilesFixed_0_, String[] p_collectFilesFixed_1_)
{
if (p_collectFilesFixed_1_ == null)
{
return new String[0];
}
else
{
List list = new ArrayList();
for (int i = 0; i < p_collectFilesFixed_1_.length; ++i)
{
String s = p_collectFilesFixed_1_[i];
ResourceLocation resourcelocation = new ResourceLocation(s);
if (p_collectFilesFixed_0_.resourceExists(resourcelocation))
{
list.add(s);
}
}
String[] astring = (String[])((String[])list.toArray(new String[list.size()]));
return astring;
}
}
示例2: getDefiningResourcePack
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static IResourcePack getDefiningResourcePack(ResourceLocation p_getDefiningResourcePack_0_)
{
IResourcePack[] airesourcepack = getResourcePacks();
for (int i = airesourcepack.length - 1; i >= 0; --i)
{
IResourcePack iresourcepack = airesourcepack[i];
if (iresourcepack.resourceExists(p_getDefiningResourcePack_0_))
{
return iresourcepack;
}
}
if (getDefaultResourcePack().resourceExists(p_getDefiningResourcePack_0_))
{
return getDefaultResourcePack();
}
else
{
return null;
}
}
示例3: 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();
}
}
示例4: collectFilesDefault
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static String[] collectFilesDefault(IResourcePack p_collectFilesDefault_0_)
{
List list = new ArrayList();
String[] astring = getDefaultCtmPaths();
for (int i = 0; i < astring.length; ++i)
{
String s = astring[i];
ResourceLocation resourcelocation = new ResourceLocation(s);
if (p_collectFilesDefault_0_.resourceExists(resourcelocation))
{
list.add(s);
}
}
String[] astring1 = (String[])((String[])list.toArray(new String[list.size()]));
return astring1;
}
示例5: 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;
}
示例6: getDefiningResourcePack
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static IResourcePack getDefiningResourcePack(ResourceLocation loc)
{
IResourcePack[] rps = getResourcePacks();
for (int i = rps.length - 1; i >= 0; --i)
{
IResourcePack rp = rps[i];
if (rp.resourceExists(loc))
{
return rp;
}
}
if (getDefaultResourcePack().resourceExists(loc))
{
return getDefaultResourcePack();
}
else
{
return null;
}
}
示例7: collectFilesDefault
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static String[] collectFilesDefault(IResourcePack rp)
{
ArrayList list = new ArrayList();
String[] names = getDefaultCtmPaths();
for (int nameArr = 0; nameArr < names.length; ++nameArr)
{
String name = names[nameArr];
ResourceLocation loc = new ResourceLocation(name);
if (rp.resourceExists(loc))
{
list.add(name);
}
}
String[] var6 = (String[])((String[])list.toArray(new String[list.size()]));
return var6;
}
示例8: getDefiningResourcePack
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static IResourcePack getDefiningResourcePack(ResourceLocation p_getDefiningResourcePack_0_)
{
ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository();
IResourcePack iresourcepack = resourcepackrepository.getResourcePackInstance();
if (iresourcepack != null && iresourcepack.resourceExists(p_getDefiningResourcePack_0_))
{
return iresourcepack;
}
else
{
List<ResourcePackRepository.Entry> list = resourcepackrepository.repositoryEntries;
for (int i = list.size() - 1; i >= 0; --i)
{
ResourcePackRepository.Entry resourcepackrepository$entry = (ResourcePackRepository.Entry)list.get(i);
IResourcePack iresourcepack1 = resourcepackrepository$entry.getResourcePack();
if (iresourcepack1.resourceExists(p_getDefiningResourcePack_0_))
{
return iresourcepack1;
}
}
if (getDefaultResourcePack().resourceExists(p_getDefiningResourcePack_0_))
{
return getDefaultResourcePack();
}
else
{
return null;
}
}
}
示例9: collectFilesFixed
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static String[] collectFilesFixed(IResourcePack p_collectFilesFixed_0_, String[] p_collectFilesFixed_1_)
{
if (p_collectFilesFixed_1_ == null)
{
return new String[0];
}
else
{
List list = new ArrayList();
for (int i = 0; i < p_collectFilesFixed_1_.length; ++i)
{
String s = p_collectFilesFixed_1_[i];
if (!isLowercase(s))
{
Config.warn("Skipping non-lowercase path: " + s);
}
else
{
ResourceLocation resourcelocation = new ResourceLocation(s);
if (p_collectFilesFixed_0_.resourceExists(resourcelocation))
{
list.add(s);
}
}
}
String[] astring = (String[])((String[])list.toArray(new String[list.size()]));
return astring;
}
}
示例10: 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;
}