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


Java AbstractResourcePack类代码示例

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

AbstractResourcePack类属于net.minecraft.client.resources包,在下文中一共展示了AbstractResourcePack类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getResourcePackFile

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public static File getResourcePackFile(AbstractResourcePack p_getResourcePackFile_0_)
{
    if (directAccessValid)
    {
        try
        {
            return p_getResourcePackFile_0_.resourcePackFile;
        }
        catch (IllegalAccessError illegalaccesserror)
        {
            directAccessValid = false;

            if (!ForgeAbstractResourcePack_resourcePackFile.exists())
            {
                throw illegalaccesserror;
            }
        }
    }

    return (File)Reflector.getFieldValue(p_getResourcePackFile_0_, ForgeAbstractResourcePack_resourcePackFile);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:ResourceUtils.java


示例2: collectFiles

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public static String[] collectFiles(IResourcePack p_collectFiles_0_, String p_collectFiles_1_, String p_collectFiles_2_, String[] p_collectFiles_3_)
{
    if (p_collectFiles_0_ instanceof DefaultResourcePack)
    {
        return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_);
    }
    else if (!(p_collectFiles_0_ instanceof AbstractResourcePack))
    {
        return new String[0];
    }
    else
    {
        AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_;
        File file1 = ResourceUtils.getResourcePackFile(abstractresourcepack);
        return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0]));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:ConnectedUtils.java


示例3: collectFiles

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public static String[] collectFiles(IResourcePack p_collectFiles_0_, String[] p_collectFiles_1_, String[] p_collectFiles_2_, String[] p_collectFiles_3_)
{
    if (p_collectFiles_0_ instanceof DefaultResourcePack)
    {
        return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_);
    }
    else if (!(p_collectFiles_0_ instanceof AbstractResourcePack))
    {
        return new String[0];
    }
    else
    {
        AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_;
        File file1 = abstractresourcepack.resourcePackFile;
        return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0]));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:ResUtils.java


示例4: collectFiles

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
private static String[] collectFiles(IResourcePack p_collectFiles_0_, String p_collectFiles_1_, String p_collectFiles_2_)
{
    if (p_collectFiles_0_ instanceof DefaultResourcePack)
    {
        return collectFilesDefault(p_collectFiles_0_);
    }
    else if (!(p_collectFiles_0_ instanceof AbstractResourcePack))
    {
        return new String[0];
    }
    else
    {
        AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_;
        File file1 = ResourceUtils.getResourcePackFile(abstractresourcepack);
        return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0]));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:ConnectedTextures.java


示例5: dedupeResourcePacks

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
private static void dedupeResourcePacks() {
    if (Boolean.getBoolean("fz.misc.dupedpacks")) return;
    Minecraft mc = Minecraft.getMinecraft();
    HashSet<File> seen = new HashSet<File>();
    int removed = 0;
    for (Iterator<IResourcePack> iter = mc.defaultResourcePacks.iterator(); iter.hasNext(); ) {
        IResourcePack pack = iter.next();
        File packFile = null;
        if (pack instanceof AbstractResourcePack) {
            AbstractResourcePack arp = (AbstractResourcePack) pack;
            packFile = arp.resourcePackFile;
        }
        if (packFile == null) continue;
        if (seen.add(packFile)) continue;
        iter.remove();
        removed++;
    }
    if (removed == 0) return;
    String thx = removed >= 10 ? " #you'rewelcome" : "";
    Core.logWarning(removed + " duplicated resourcepacks were removed." + thx);
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:22,代码来源:MiscClientProxy.java


示例6: generateSoundJSON

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
/**
 * Dynamically generates a sound JSON file based on a resource pack's file structure.
 *
 * If it's a folder, then load it as a sound collection.
 * A sound collection falls under the same resource name. When called to play, it will pick a random sound from the collection to play it.
 *
 * If it's just a sound file, then load the sound file
 *
 * @param pack The resource pack to generate the sound JSON for.
 * @return The generated sound JSON.
 */
public static String generateSoundJSON(AbstractResourcePack pack) {
	StringWriter sw = new StringWriter();
	try (JsonGenerator json = Json.createGenerator(sw);) {
		json.writeStartObject();
		if (pack instanceof FileResourcePack) {
			//For zip resource packs
			try {
				generateSoundJSON((FileResourcePack) pack, json);
			} catch (Exception e) {
				Error error = new ExceptionInInitializerError("Error generating fake sound JSON file.");
				error.addSuppressed(e);
				throw error;
			}
		} else if (pack instanceof FolderResourcePack) {
			//For folder resource packs
			generateSoundJSON((FolderResourcePack) pack, json);
		}
		json.writeEnd().flush();
		return sw.toString();
	}
}
 
开发者ID:NOVA-Team,项目名称:NOVA-Core,代码行数:33,代码来源:NovaMinecraftPreloader.java


示例7: getResourcePackFile

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public static File getResourcePackFile(AbstractResourcePack arp)
{
    if (directAccessValid)
    {
        try
        {
            return arp.resourcePackFile;
        }
        catch (IllegalAccessError var2)
        {
            directAccessValid = false;

            if (!ForgeAbstractResourcePack_resourcePackFile.exists())
            {
                throw var2;
            }
        }
    }

    return (File)Reflector.getFieldValue(arp, ForgeAbstractResourcePack_resourcePackFile);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:ResourceUtils.java


示例8: collectFiles

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
private static String[] collectFiles(IResourcePack rp, String prefix, String suffix)
{
    if (rp instanceof DefaultResourcePack)
    {
        return collectFilesDefault(rp);
    }
    else if (!(rp instanceof AbstractResourcePack))
    {
        return new String[0];
    }
    else
    {
        AbstractResourcePack arp = (AbstractResourcePack)rp;
        File tpFile = ResourceUtils.getResourcePackFile(arp);
        return tpFile == null ? new String[0] : (tpFile.isDirectory() ? collectFilesFolder(tpFile, "", prefix, suffix) : (tpFile.isFile() ? collectFilesZIP(tpFile, prefix, suffix) : new String[0]));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:18,代码来源:ConnectedTextures.java


示例9: func_110603_a

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public void func_110603_a(File p_110603_1_) {
   if(p_110603_1_.isDirectory()) {
      File[] var2 = p_110603_1_.listFiles();
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         File var5 = var2[var4];
         this.func_110603_a(var5);
      }
   } else {
      this.func_110604_a(AbstractResourcePack.func_110595_a(this.field_110607_c, p_110603_1_), p_110603_1_);
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:DefaultResourcePack.java


示例10: collectFiles

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public static String[] collectFiles(IResourcePack p_collectFiles_0_, String[] p_collectFiles_1_, String[] p_collectFiles_2_, String[] p_collectFiles_3_)
{
    if (p_collectFiles_0_ instanceof DefaultResourcePack)
    {
        return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_);
    }
    else
    {
        if (p_collectFiles_0_ instanceof LegacyV2Adapter)
        {
            IResourcePack iresourcepack = (IResourcePack)Reflector.getFieldValue(p_collectFiles_0_, Reflector.LegacyV2Adapter_pack);

            if (iresourcepack == null)
            {
                Config.warn("LegacyV2Adapter base resource pack not found: " + p_collectFiles_0_);
                return new String[0];
            }

            p_collectFiles_0_ = iresourcepack;
        }

        if (!(p_collectFiles_0_ instanceof AbstractResourcePack))
        {
            Config.warn("Unknown resource pack type: " + p_collectFiles_0_);
            return new String[0];
        }
        else
        {
            AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_;
            File file1 = abstractresourcepack.resourcePackFile;

            if (file1 == null)
            {
                return new String[0];
            }
            else if (file1.isDirectory())
            {
                return collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_);
            }
            else if (file1.isFile())
            {
                return collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_);
            }
            else
            {
                Config.warn("Unknown resource pack file: " + file1);
                return new String[0];
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:ResUtils.java


示例11: func_135058_a

import net.minecraft.client.resources.AbstractResourcePack; //导入依赖的package包/类
public MetadataSection func_135058_a(MetadataSerializer p_135058_1_, String p_135058_2_) throws IOException {
   return AbstractResourcePack.func_110596_a(p_135058_1_, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).func_110623_a()), p_135058_2_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:DefaultResourcePack.java



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