Search in sources :

Example 1 with ResourcePackEntry

use of icyllis.modernui.impl.setting.ResourcePackEntry in project ModernUI by BloCamLimb.

the class SettingResourcePack method applyResourcePacks.

private void applyResourcePacks() {
    List<ResourcePackInfo> list = Lists.newArrayList();
    GameSettings gameSettings = minecraft.gameSettings;
    for (ResourcePackEntry c2 : selectedGroup.getEntries()) {
        list.add(c2.getResourcePack());
    }
    Collections.reverse(list);
    // FIXME
    // minecraft.getResourcePackList().setEnabledPacks(list);
    gameSettings.resourcePacks.clear();
    gameSettings.incompatibleResourcePacks.clear();
    for (ResourcePackInfo c3 : list) {
        if (!c3.isOrderLocked()) {
            gameSettings.resourcePacks.add(c3.getName());
            if (!c3.getCompatibility().isCompatible()) {
                gameSettings.incompatibleResourcePacks.add(c3.getName());
            }
        }
    }
    gameSettings.saveOptions();
    minecraft.reloadResources();
    applyButton.setStatus(WidgetStatus.INACTIVE, false);
}
Also used : ResourcePackEntry(icyllis.modernui.impl.setting.ResourcePackEntry) GameSettings(net.minecraft.client.GameSettings) ResourcePackInfo(net.minecraft.resources.ResourcePackInfo)

Aggregations

ResourcePackEntry (icyllis.modernui.impl.setting.ResourcePackEntry)1 GameSettings (net.minecraft.client.GameSettings)1 ResourcePackInfo (net.minecraft.resources.ResourcePackInfo)1