Java 类net.minecraft.client.resources.ResourcePackRepository 实例源码

项目:DecompiledMinecraft    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.func_181538_aA());
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:BaseClient    文件:Config.java   
public static IResourcePack[] getResourcePacks()
{
    ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository();
    List list = resourcepackrepository.getRepositoryEntries();
    List list1 = new ArrayList();

    for (Object resourcepackrepository$entry : list)
    {
        list1.add(((ResourcePackRepository.Entry)resourcepackrepository$entry).getResourcePack());
    }

    if (resourcepackrepository.getResourcePackInstance() != null)
    {
        list1.add(resourcepackrepository.getResourcePackInstance());
    }

    IResourcePack[] airesourcepack = (IResourcePack[])((IResourcePack[])list1.toArray(new IResourcePack[list1.size()]));
    return airesourcepack;
}
项目:BaseClient    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.func_181538_aA());
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:BaseClient    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) {
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf(
            (MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.func_181538_aA());
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("resource_packs",
            Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository
            .getRepositoryEntries()) {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]",
                resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) {
        playerSnooper.addClientStat("snooper_partner",
                this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Zombe-Modpack    文件:Minecraft.java   
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.getCurrentAction());
    playerSnooper.addClientStat("language", this.gameSettings.language == null ? "en_us" : this.gameSettings.language);
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("subtitles", Boolean.valueOf(this.gameSettings.showSubtitles));
    playerSnooper.addClientStat("touch", this.gameSettings.touchscreen ? "touch" : "mouse");
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Backmemed    文件:Minecraft.java   
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.getCurrentAction());
    playerSnooper.addClientStat("language", this.gameSettings.language == null ? "en_us" : this.gameSettings.language);
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("subtitles", Boolean.valueOf(this.gameSettings.showSubtitles));
    playerSnooper.addClientStat("touch", this.gameSettings.touchscreen ? "touch" : "mouse");
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Backmemed    文件:Config.java   
public static IResourcePack[] getResourcePacks()
{
    ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository();
    List list = resourcepackrepository.getRepositoryEntries();
    List list1 = new ArrayList();

    for (Object  resourcepackrepository$entry : list)
    {
        list1.add(((ResourcePackRepository.Entry) resourcepackrepository$entry).getResourcePack());
    }

    if (resourcepackrepository.getResourcePackInstance() != null)
    {
        list1.add(resourcepackrepository.getResourcePackInstance());
    }

    IResourcePack[] airesourcepack = (IResourcePack[])((IResourcePack[])list1.toArray(new IResourcePack[list1.size()]));
    return airesourcepack;
}
项目:CustomWorldGen    文件:Minecraft.java   
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.getCurrentAction());
    playerSnooper.addClientStat("language", this.gameSettings.language == null ? "en_US" : this.gameSettings.language);
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("subtitles", Boolean.valueOf(this.gameSettings.showSubtitles));
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:ExtraUtilities    文件:TConTextureResourcePackBedrockium.java   
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;
}
项目:DynamicSurroundings    文件:ResourcePacks.java   
@Nonnull
public List<IResourcePack> findResourcePacks() {
    final List<ResourcePackRepository.Entry> repo = Minecraft.getMinecraft().getResourcePackRepository()
            .getRepositoryEntries();

    final List<IResourcePack> foundEntries = new ArrayList<IResourcePack>();
    foundEntries.add(new DefaultPack());

    // Add a default back for mods that are loaded - there may be a default
    // configuration privided in the archive
    for (final ModContainer mod : Loader.instance().getActiveModList())
        foundEntries.add(new DefaultPack(mod.getModId()));

    // Look in other resource packs for more configuration data
    for (final ResourcePackRepository.Entry pack : repo) {
        DSurround.log().debug("Resource Pack: %s", pack.getResourcePackName());
        if (checkCompatible(pack)) {
            DSurround.log().debug("Found FootstepsRegistry resource pack: %s", pack.getResourcePackName());
            foundEntries.add(pack.getResourcePack());
        }
    }
    return foundEntries;
}
项目:Resilience-Client-Source    文件:Minecraft.java   
public void refreshResources()
{
    ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks);
    Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (var2.hasNext())
    {
        ResourcePackRepository.Entry var3 = (ResourcePackRepository.Entry)var2.next();
        var1.add(var3.getResourcePack());
    }

    if (this.mcResourcePackRepository.func_148530_e() != null)
    {
        var1.add(this.mcResourcePackRepository.func_148530_e());
    }

    this.mcLanguageManager.parseLanguageMetadata(var1);
    this.mcResourceManager.reloadResources(var1);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:Resilience-Client-Source    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)
{
    par1PlayerUsageSnooper.addData("fps", Integer.valueOf(debugFPS));
    par1PlayerUsageSnooper.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    par1PlayerUsageSnooper.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    par1PlayerUsageSnooper.addData("display_type", this.fullscreen ? "fullscreen" : "windowed");
    par1PlayerUsageSnooper.addData("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - par1PlayerUsageSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    par1PlayerUsageSnooper.addData("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int var2 = 0;
    Iterator var3 = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (var3.hasNext())
    {
        ResourcePackRepository.Entry var4 = (ResourcePackRepository.Entry)var3.next();
        par1PlayerUsageSnooper.addData("resource_pack[" + var2++ + "]", var4.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        par1PlayerUsageSnooper.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Resilience-Client-Source    文件:Config.java   
public static IResourcePack[] getResourcePacks()
{
    ResourcePackRepository rep = minecraft.getResourcePackRepository();
    List entries = rep.getRepositoryEntries();
    ArrayList list = new ArrayList();
    Iterator rps = entries.iterator();

    while (rps.hasNext())
    {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)rps.next();
        list.add(entry.getResourcePack());
    }

    IResourcePack[] rps1 = (IResourcePack[])((IResourcePack[])list.toArray(new IResourcePack[list.size()]));
    return rps1;
}
项目:ExpandedRailsMod    文件:Minecraft.java   
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS));
    playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed");
    playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("current_action", this.getCurrentAction());
    playerSnooper.addClientStat("language", this.gameSettings.language == null ? "en_US" : this.gameSettings.language);
    String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big";
    playerSnooper.addClientStat("endianness", s);
    playerSnooper.addClientStat("subtitles", Boolean.valueOf(this.gameSettings.showSubtitles));
    playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Cauldron    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper p_70000_1_)
{
    p_70000_1_.func_152768_a("fps", Integer.valueOf(debugFPS));
    p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    p_70000_1_.func_152768_a("display_type", this.fullscreen ? "fullscreen" : "windowed");
    p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - p_70000_1_.getMinecraftStartTimeMillis()) / 60L * 1000L));
    p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;
    Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (iterator.hasNext())
    {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next();
        p_70000_1_.func_152768_a("resource_pack[" + i++ + "]", entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        p_70000_1_.func_152768_a("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:Cauldron    文件:Minecraft.java   
public void addServerStatsToSnooper(PlayerUsageSnooper p_70000_1_)
{
    p_70000_1_.func_152768_a("fps", Integer.valueOf(debugFPS));
    p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync));
    p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency()));
    p_70000_1_.func_152768_a("display_type", this.fullscreen ? "fullscreen" : "windowed");
    p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - p_70000_1_.getMinecraftStartTimeMillis()) / 60L * 1000L));
    p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size()));
    int i = 0;
    Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (iterator.hasNext())
    {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next();
        p_70000_1_.func_152768_a("resource_pack[" + i++ + "]", entry.getResourcePackName());
    }

    if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null)
    {
        p_70000_1_.func_152768_a("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID());
    }
}
项目:CartLivery    文件:LiveryTextureRegistry.java   
@SuppressWarnings("unchecked")
public void onResourceManagerReload(IResourceManager var1) {
    // release OpenGL resources
    for (LiveryTextureInfo info : map.values()) Minecraft.getMinecraft().renderEngine.deleteTexture(info.texture);
    map.clear();

    // list liveries in currently loaded resource packs
    ResourcePackRepository repo = Minecraft.getMinecraft().getResourcePackRepository();
    List<ResourcePackRepository.Entry> packList = repo.getRepositoryEntries();
    for (ResourcePackRepository.Entry loadedPack : packList) {
        try {
            LiveryListMetadata metadata = (LiveryListMetadata) loadedPack.getResourcePack().getPackMetadata(serializer, "cartlivery");
            for (String liveryName : metadata.definedLiveries) {
                registerLivery(liveryName, I18n.format("cartlivery.respack", loadedPack.getResourcePackName()));
            }
        } catch (IOException e) {
            // probably no pack.mcmeta - ignore it, it will be logged anyway 
        }
    }

    // finally add built-in liveries
    for(String builtInName : builtInLiveries.keySet()) registerLivery(builtInName, I18n.format("cartlivery.builtin", builtInLiveries.get(builtInName)));
}
项目:DecompiledMinecraft    文件:GuiScreenResourcePacks.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));

    if (!this.changed)
    {
        this.availableResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        this.selectedResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
        resourcepackrepository.updateRepositoryEntriesAll();
        List<ResourcePackRepository.Entry> list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
        list.removeAll(resourcepackrepository.getRepositoryEntries());

        for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
        {
            this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
        }

        for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries()))
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
        }

        this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
    }

    this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks);
    this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.availableResourcePacksList.registerScrollButtons(7, 8);
    this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks);
    this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.selectedResourcePacksList.registerScrollButtons(7, 8);
}
项目:DecompiledMinecraft    文件:Minecraft.java   
public void refreshResources()
{
    List<IResourcePack> list = Lists.newArrayList(this.defaultResourcePacks);

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        list.add(resourcepackrepository$entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.getResourcePackInstance() != null)
    {
        list.add(this.mcResourcePackRepository.getResourcePackInstance());
    }

    try
    {
        this.mcResourceManager.reloadResources(list);
    }
    catch (RuntimeException runtimeexception)
    {
        logger.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
        list.clear();
        list.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.setRepositories(Collections.<ResourcePackRepository.Entry>emptyList());
        this.mcResourceManager.reloadResources(list);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.field_183018_l.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(list);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:BaseClient    文件:GuiScreenResourcePacks.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));

    if (!this.changed)
    {
        this.availableResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        this.selectedResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
        resourcepackrepository.updateRepositoryEntriesAll();
        List<ResourcePackRepository.Entry> list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
        list.removeAll(resourcepackrepository.getRepositoryEntries());

        for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
        {
            this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
        }

        for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries()))
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
        }

        this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
    }

    this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks);
    this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.availableResourcePacksList.registerScrollButtons(7, 8);
    this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks);
    this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.selectedResourcePacksList.registerScrollButtons(7, 8);
}
项目:BaseClient    文件:Minecraft.java   
public void refreshResources()
{
    List<IResourcePack> list = Lists.newArrayList(this.defaultResourcePacks);

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        list.add(resourcepackrepository$entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.getResourcePackInstance() != null)
    {
        list.add(this.mcResourcePackRepository.getResourcePackInstance());
    }

    try
    {
        this.mcResourceManager.reloadResources(list);
    }
    catch (RuntimeException runtimeexception)
    {
        logger.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
        list.clear();
        list.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.setRepositories(Collections.<ResourcePackRepository.Entry>emptyList());
        this.mcResourceManager.reloadResources(list);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.field_183018_l.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(list);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:BaseClient    文件:Config.java   
public static IResourcePack[] getResourcePacks()
{
    ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository();
    List list = resourcepackrepository.getRepositoryEntries();
    List list1 = new ArrayList();

    for (Object resourcepackrepository$entry : list)
    {
        list1.add(((ResourcePackRepository.Entry) resourcepackrepository$entry).getResourcePack());
    }

    IResourcePack[] airesourcepack = (IResourcePack[])((IResourcePack[])list1.toArray(new IResourcePack[list1.size()]));
    return airesourcepack;
}
项目:BaseClient    文件:GuiScreenResourcePacks.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));

    if (!this.changed)
    {
        this.availableResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        this.selectedResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
        resourcepackrepository.updateRepositoryEntriesAll();
        List<ResourcePackRepository.Entry> list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
        list.removeAll(resourcepackrepository.getRepositoryEntries());

        for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
        {
            this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
        }

        for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries()))
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
        }

        this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
    }

    this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks);
    this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.availableResourcePacksList.registerScrollButtons(7, 8);
    this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks);
    this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.selectedResourcePacksList.registerScrollButtons(7, 8);
}
项目:BaseClient    文件:Minecraft.java   
public void refreshResources() {
    List<IResourcePack> list = Lists.newArrayList(this.defaultResourcePacks);

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository
            .getRepositoryEntries()) {
        list.add(resourcepackrepository$entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.getResourcePackInstance() != null) {
        list.add(this.mcResourcePackRepository.getResourcePackInstance());
    }

    try {
        this.mcResourceManager.reloadResources(list);
    } catch (RuntimeException runtimeexception) {
        logger.info((String) "Caught error stitching, removing all assigned resourcepacks",
                (Throwable) runtimeexception);
        list.clear();
        list.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.setRepositories(Collections.<ResourcePackRepository.Entry>emptyList());
        this.mcResourceManager.reloadResources(list);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.field_183018_l.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(list);

    if (this.renderGlobal != null) {
        this.renderGlobal.loadRenderers();
    }
}
项目:Backmemed    文件:Config.java   
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;
        }
    }
}
项目:ExtraUtilities    文件:TConTextureResourcePackBase.java   
public List<IResourcePack> getPacks() {
    if (this.resourcePackz == null) {
        (this.resourcePackz = new ArrayList<IResourcePack>()).add(this.delegate);
        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.getResourceDomains().contains("tinker")) {
                this.resourcePackz.add(resourcePack);
            }
        }
    }
    return this.resourcePackz;
}
项目:MineLittlePony    文件:LayerPonyArmor.java   
private Tuple<ResourceLocation, Boolean> getArmorTexture(EntityLivingBase entity, ItemStack itemstack, EntityEquipmentSlot slot, @Nullable String type) {
    ItemArmor item = (ItemArmor) itemstack.getItem();
    String texture = item.getArmorMaterial().getName();
    String domain = "minecraft";
    int idx = texture.indexOf(':');
    if (idx != -1) {
        domain = texture.substring(0, idx);
        texture = texture.substring(idx + 1);
    }
    String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, slot == EntityEquipmentSlot.LEGS ? 2 : 1,
            type == null ? "" : String.format("_%s", type));
    s1 = getArmorTexture(entity, itemstack, s1, slot, type);
    ResourceLocation human = getHumanResource(s1);
    ResourceLocation pony = getPonyResource(human);

    // check resource packs for either texture.
    for (ResourcePackRepository.Entry entry : Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries()) {
        if (entry.getResourcePack().resourceExists(pony)) {
            // ponies are more important
            return new Tuple<>(pony, true);
        } else if (entry.getResourcePack().resourceExists(human)) {
            // but I guess I'll take a human
            return new Tuple<>(human, false);
        }
    }
    // the default pack
    try {
        Minecraft.getMinecraft().getResourceManager().getResource(pony);
        return new Tuple<>(pony, true);
    } catch (IOException e) {
        return new Tuple<>(human, false);
    }
}
项目:DynamicSurroundings    文件:RegistryManager.java   
public List<InputStream> getAdditionalScripts() {
    if (this.side == Side.SERVER)
        return ImmutableList.of();

    final List<ResourcePackRepository.Entry> repo = Minecraft.getMinecraft().getResourcePackRepository()
            .getRepositoryEntries();

    final List<InputStream> streams = new ArrayList<InputStream>();

    // Look in other resource packs for more configuration data
    for (final ResourcePackRepository.Entry pack : repo) {
        if (checkCompatible(pack)) {
            DSurround.log().debug("Found script in resource pack: %s", pack.getResourcePackName());
            try {
                final InputStream stream = openScript(pack.getResourcePack());
                if (stream != null)
                    streams.add(stream);
            } catch (final Throwable t) {
                DSurround.log().error("Unable to open script in resource pack", t);
            }
        }
    }

    // Tack on built-in profiles
    streams.addAll(Profiles.getProfileStreams());

    return streams;
}
项目:Resilience-Client-Source    文件:GuiScreenResourcePacks.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
    this.field_146966_g = new ArrayList();
    this.field_146969_h = new ArrayList();
    ResourcePackRepository var1 = this.mc.getResourcePackRepository();
    var1.updateRepositoryEntriesAll();
    ArrayList var2 = Lists.newArrayList(var1.getRepositoryEntriesAll());
    var2.removeAll(var1.getRepositoryEntries());
    Iterator var3 = var2.iterator();
    ResourcePackRepository.Entry var4;

    while (var3.hasNext())
    {
        var4 = (ResourcePackRepository.Entry)var3.next();
        this.field_146966_g.add(new ResourcePackListEntryFound(this, var4));
    }

    var3 = Lists.reverse(var1.getRepositoryEntries()).iterator();

    while (var3.hasNext())
    {
        var4 = (ResourcePackRepository.Entry)var3.next();
        this.field_146969_h.add(new ResourcePackListEntryFound(this, var4));
    }

    this.field_146969_h.add(new ResourcePackListEntryDefault(this));
    this.field_146970_i = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g);
    this.field_146970_i.func_148140_g(this.width / 2 - 4 - 200);
    this.field_146970_i.func_148134_d(7, 8);
    this.field_146967_r = new GuiResourcePackSelected(this.mc, 200, this.height, this.field_146969_h);
    this.field_146967_r.func_148140_g(this.width / 2 + 4);
    this.field_146967_r.func_148134_d(7, 8);
}
项目:Cauldron    文件:GuiScreenResourcePacks.java   
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
    this.field_146966_g = new ArrayList();
    this.field_146969_h = new ArrayList();
    ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
    resourcepackrepository.updateRepositoryEntriesAll();
    ArrayList arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
    arraylist.removeAll(resourcepackrepository.getRepositoryEntries());
    Iterator iterator = arraylist.iterator();
    ResourcePackRepository.Entry entry;

    while (iterator.hasNext())
    {
        entry = (ResourcePackRepository.Entry)iterator.next();
        this.field_146966_g.add(new ResourcePackListEntryFound(this, entry));
    }

    iterator = Lists.reverse(resourcepackrepository.getRepositoryEntries()).iterator();

    while (iterator.hasNext())
    {
        entry = (ResourcePackRepository.Entry)iterator.next();
        this.field_146969_h.add(new ResourcePackListEntryFound(this, entry));
    }

    this.field_146969_h.add(new ResourcePackListEntryDefault(this));
    this.field_146970_i = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g);
    this.field_146970_i.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.field_146970_i.registerScrollButtons(7, 8);
    this.field_146967_r = new GuiResourcePackSelected(this.mc, 200, this.height, this.field_146969_h);
    this.field_146967_r.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.field_146967_r.registerScrollButtons(7, 8);
}
项目:Cauldron    文件:Minecraft.java   
public void refreshResources()
{
    ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks);
    Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (iterator.hasNext())
    {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next();
        arraylist.add(entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.func_148530_e() != null)
    {
        arraylist.add(this.mcResourcePackRepository.func_148530_e());
    }

    try
    {
        this.mcResourceManager.reloadResources(arraylist);
    }
    catch (RuntimeException runtimeexception)
    {
        logger.info("Caught error stitching, removing all assigned resourcepacks", runtimeexception);
        arraylist.clear();
        arraylist.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.func_148527_a(Collections.emptyList());
        this.mcResourceManager.reloadResources(arraylist);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(arraylist);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:Cauldron    文件:GuiScreenResourcePacks.java   
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
    this.field_146966_g = new ArrayList();
    this.field_146969_h = new ArrayList();
    ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
    resourcepackrepository.updateRepositoryEntriesAll();
    ArrayList arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
    arraylist.removeAll(resourcepackrepository.getRepositoryEntries());
    Iterator iterator = arraylist.iterator();
    ResourcePackRepository.Entry entry;

    while (iterator.hasNext())
    {
        entry = (ResourcePackRepository.Entry)iterator.next();
        this.field_146966_g.add(new ResourcePackListEntryFound(this, entry));
    }

    iterator = Lists.reverse(resourcepackrepository.getRepositoryEntries()).iterator();

    while (iterator.hasNext())
    {
        entry = (ResourcePackRepository.Entry)iterator.next();
        this.field_146969_h.add(new ResourcePackListEntryFound(this, entry));
    }

    this.field_146969_h.add(new ResourcePackListEntryDefault(this));
    this.field_146970_i = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g);
    this.field_146970_i.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.field_146970_i.registerScrollButtons(7, 8);
    this.field_146967_r = new GuiResourcePackSelected(this.mc, 200, this.height, this.field_146969_h);
    this.field_146967_r.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.field_146967_r.registerScrollButtons(7, 8);
}
项目:Cauldron    文件:Minecraft.java   
public void refreshResources()
{
    ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks);
    Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator();

    while (iterator.hasNext())
    {
        ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next();
        arraylist.add(entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.func_148530_e() != null)
    {
        arraylist.add(this.mcResourcePackRepository.func_148530_e());
    }

    try
    {
        this.mcResourceManager.reloadResources(arraylist);
    }
    catch (RuntimeException runtimeexception)
    {
        logger.info("Caught error stitching, removing all assigned resourcepacks", runtimeexception);
        arraylist.clear();
        arraylist.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.func_148527_a(Collections.emptyList());
        this.mcResourceManager.reloadResources(arraylist);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(arraylist);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:DecompiledMinecraft    文件:Minecraft.java   
public ResourcePackRepository getResourcePackRepository()
{
    return this.mcResourcePackRepository;
}
项目:BaseClient    文件:Minecraft.java   
public ResourcePackRepository getResourcePackRepository()
{
    return this.mcResourcePackRepository;
}
项目:BaseClient    文件:Minecraft.java   
public ResourcePackRepository getResourcePackRepository() {
    return this.mcResourcePackRepository;
}
项目:Zombe-Modpack    文件:Minecraft.java   
public void refreshResources()
{
    List<IResourcePack> list = Lists.newArrayList(this.defaultResourcePacks);

    if (this.theIntegratedServer != null)
    {
        this.theIntegratedServer.reloadLootTables();
    }

    for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries())
    {
        list.add(resourcepackrepository$entry.getResourcePack());
    }

    if (this.mcResourcePackRepository.getResourcePackInstance() != null)
    {
        list.add(this.mcResourcePackRepository.getResourcePackInstance());
    }

    try
    {
        this.mcResourceManager.reloadResources(list);
    }
    catch (RuntimeException runtimeexception)
    {
        LOGGER.info((String)"Caught error stitching, removing all assigned resourcepacks", (Throwable)runtimeexception);
        list.clear();
        list.addAll(this.defaultResourcePacks);
        this.mcResourcePackRepository.setRepositories(Collections.<ResourcePackRepository.Entry>emptyList());
        this.mcResourceManager.reloadResources(list);
        this.gameSettings.resourcePacks.clear();
        this.gameSettings.incompatibleResourcePacks.clear();
        this.gameSettings.saveOptions();
    }

    this.mcLanguageManager.parseLanguageMetadata(list);

    if (this.renderGlobal != null)
    {
        this.renderGlobal.loadRenderers();
    }
}
项目:Zombe-Modpack    文件:Minecraft.java   
public ResourcePackRepository getResourcePackRepository()
{
    return this.mcResourcePackRepository;
}
项目:Backmemed    文件:GuiScreenResourcePacks.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0])));
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));

    if (!this.changed)
    {
        this.availableResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        this.selectedResourcePacks = Lists.<ResourcePackListEntry>newArrayList();
        ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
        resourcepackrepository.updateRepositoryEntriesAll();
        List<ResourcePackRepository.Entry> list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
        list.removeAll(resourcepackrepository.getRepositoryEntries());

        for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
        {
            this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
        }

        ResourcePackRepository.Entry resourcepackrepository$entry2 = resourcepackrepository.getResourcePackEntry();

        if (resourcepackrepository$entry2 != null)
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryServer(this, resourcepackrepository.getResourcePackInstance()));
        }

        for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries()))
        {
            this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
        }

        this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
    }

    this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks);
    this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200);
    this.availableResourcePacksList.registerScrollButtons(7, 8);
    this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks);
    this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4);
    this.selectedResourcePacksList.registerScrollButtons(7, 8);
}
项目:Backmemed    文件:GuiScreenResourcePacks.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 2)
        {
            File file1 = this.mc.getResourcePackRepository().getDirResourcepacks();
            OpenGlHelper.openFile(file1);
        }
        else if (button.id == 1)
        {
            if (this.changed)
            {
                List<ResourcePackRepository.Entry> list = Lists.<ResourcePackRepository.Entry>newArrayList();

                for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks)
                {
                    if (resourcepacklistentry instanceof ResourcePackListEntryFound)
                    {
                        list.add(((ResourcePackListEntryFound)resourcepacklistentry).getResourcePackEntry());
                    }
                }

                Collections.reverse(list);
                this.mc.getResourcePackRepository().setRepositories(list);
                this.mc.gameSettings.resourcePacks.clear();
                this.mc.gameSettings.incompatibleResourcePacks.clear();

                for (ResourcePackRepository.Entry resourcepackrepository$entry : list)
                {
                    this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName());

                    if (resourcepackrepository$entry.getPackFormat() != 3)
                    {
                        this.mc.gameSettings.incompatibleResourcePacks.add(resourcepackrepository$entry.getResourcePackName());
                    }
                }

                this.mc.gameSettings.saveOptions();
                this.mc.refreshResources();
            }

            this.mc.displayGuiScreen(this.parentScreen);
        }
    }
}