Java 类net.minecraft.client.AnvilConverterException 实例源码

项目:DecompiledMinecraft    文件:SaveFormatOld.java   
public List<SaveFormatComparator> getSaveList() throws AnvilConverterException
{
    List<SaveFormatComparator> list = Lists.<SaveFormatComparator>newArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            list.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return list;
}
项目:DecompiledMinecraft    文件:GuiSelectWorld.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.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SPECTATOR.getID()] = I18n.format("gameMode.spectator", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List(this.mc);
    this.field_146638_t.registerScrollButtons(4, 5);
    this.func_146618_g();
}
项目:DecompiledMinecraft    文件:GuiSelectWorld.java   
public void confirmClicked(boolean result, int id)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (result)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.func_146621_a(id));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:BaseClient    文件:SaveFormatOld.java   
public List<SaveFormatComparator> getSaveList() throws AnvilConverterException
{
    List<SaveFormatComparator> list = Lists.<SaveFormatComparator>newArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            list.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return list;
}
项目:BaseClient    文件:GuiSelectWorld.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.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SPECTATOR.getID()] = I18n.format("gameMode.spectator", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List(this.mc);
    this.field_146638_t.registerScrollButtons(4, 5);
    this.func_146618_g();
}
项目:BaseClient    文件:GuiSelectWorld.java   
public void confirmClicked(boolean result, int id)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (result)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.func_146621_a(id));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:BaseClient    文件:SaveFormatOld.java   
public List<SaveFormatComparator> getSaveList() throws AnvilConverterException
{
    List<SaveFormatComparator> list = Lists.<SaveFormatComparator>newArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            list.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return list;
}
项目:BaseClient    文件:GuiSelectWorld.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.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SPECTATOR.getID()] = I18n.format("gameMode.spectator", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List(this.mc);
    this.field_146638_t.registerScrollButtons(4, 5);
    this.func_146618_g();
}
项目:BaseClient    文件:GuiSelectWorld.java   
public void confirmClicked(boolean result, int id)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (result)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.func_146621_a(id));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:Proyecto-DASI    文件:MapFileHelper.java   
/**
 * Attempts to delete all Minecraft Worlds with "TEMP_" in front of the name
 * @param currentWorld excludes this world from deletion, can be null
 */
public static void cleanupTemporaryWorlds(String currentWorld){
    List<SaveFormatComparator> saveList;
    ISaveFormat isaveformat = Minecraft.getMinecraft().getSaveLoader();
    isaveformat.flushCache();

    try{
        saveList = isaveformat.getSaveList();
    } catch (AnvilConverterException e){
        e.printStackTrace();
        return;
    }

    String searchString = tempMark + AddressHelper.getMissionControlPort() + "_";

    for (SaveFormatComparator s: saveList){
        String folderName = s.getFileName();
        if (folderName.startsWith(searchString) && !folderName.equals(currentWorld)){
            isaveformat.deleteWorldDirectory(folderName);
        }
    }
}
项目:Proyecto-DASI    文件:MapFileHelper.java   
/**
 * Attempts to delete all Minecraft Worlds with "TEMP_" in front of the name
 * @param currentWorld excludes this world from deletion, can be null
 */
public static void cleanupTemporaryWorlds(String currentWorld){
    List<SaveFormatComparator> saveList;
    ISaveFormat isaveformat = Minecraft.getMinecraft().getSaveLoader();
    isaveformat.flushCache();

    try{
        saveList = isaveformat.getSaveList();
    } catch (AnvilConverterException e){
        e.printStackTrace();
        return;
    }

    String searchString = tempMark + AddressHelper.getMissionControlPort() + "_";

    for (SaveFormatComparator s: saveList){
        String folderName = s.getFileName();
        if (folderName.startsWith(searchString) && !folderName.equals(currentWorld)){
            isaveformat.deleteWorldDirectory(folderName);
        }
    }
}
项目:Backmemed    文件:SaveFormatOld.java   
public List<WorldSummary> getSaveList() throws AnvilConverterException
{
    List<WorldSummary> list = Lists.<WorldSummary>newArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            list.add(new WorldSummary(worldinfo, s, "", worldinfo.getSizeOnDisk(), false));
        }
    }

    return list;
}
项目:Backmemed    文件:GuiListWorldSelection.java   
public void refreshList()
{
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    List<WorldSummary> list;

    try
    {
        list = isaveformat.getSaveList();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        LOGGER.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen(I18n.format("selectWorld.unable_to_load", new Object[0]), anvilconverterexception.getMessage()));
        return;
    }

    Collections.sort(list);

    for (WorldSummary worldsummary : list)
    {
        this.entries.add(new GuiListWorldSelectionEntry(this, worldsummary, this.mc.getSaveLoader()));
    }
}
项目:CustomWorldGen    文件:SaveFormatOld.java   
@SideOnly(Side.CLIENT)
public List<WorldSummary> getSaveList() throws AnvilConverterException
{
    List<WorldSummary> list = Lists.<WorldSummary>newArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            list.add(new WorldSummary(worldinfo, s, "", worldinfo.getSizeOnDisk(), false));
        }
    }

    return list;
}
项目:CustomWorldGen    文件:GuiListWorldSelection.java   
public void refreshList()
{
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    List<WorldSummary> list;

    try
    {
        list = isaveformat.getSaveList();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        LOGGER.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    Collections.sort(list);

    for (WorldSummary worldsummary : list)
    {
        this.entries.add(new GuiListWorldSelectionEntry(this, worldsummary, this.mc.getSaveLoader()));
    }
}
项目:malmo    文件:MapFileHelper.java   
/**
 * Attempts to delete all Minecraft Worlds with "TEMP_" in front of the name
 * @param currentWorld excludes this world from deletion, can be null
 */
public static void cleanupTemporaryWorlds(String currentWorld){
    List<WorldSummary> saveList;
    ISaveFormat isaveformat = Minecraft.getMinecraft().getSaveLoader();
    isaveformat.flushCache();

    try{
        saveList = isaveformat.getSaveList();
    } catch (AnvilConverterException e){
        e.printStackTrace();
        return;
    }

    String searchString = tempMark + AddressHelper.getMissionControlPort() + "_";

    for (WorldSummary s: saveList){
        String folderName = s.getFileName();
        if (folderName.startsWith(searchString) && !folderName.equals(currentWorld)){
            isaveformat.deleteWorldDirectory(folderName);
        }
    }
}
项目:Resilience-Client-Source    文件:SaveFormatOld.java   
public List getSaveList() throws AnvilConverterException
{
    ArrayList var1 = new ArrayList();

    for (int var2 = 0; var2 < 5; ++var2)
    {
        String var3 = "World" + (var2 + 1);
        WorldInfo var4 = this.getWorldInfo(var3);

        if (var4 != null)
        {
            var1.add(new SaveFormatComparator(var3, "", var4.getLastTimePlayed(), var4.getSizeOnDisk(), var4.getGameType(), false, var4.isHardcoreModeEnabled(), var4.areCommandsAllowed()));
        }
    }

    return var1;
}
项目:Resilience-Client-Source    文件:GuiSelectWorld.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException var2)
    {
        logger.error("Couldn\'t load level list", var2);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", var2.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List();
    this.field_146638_t.func_148134_d(4, 5);
    this.func_146618_g();
}
项目:Resilience-Client-Source    文件:GuiSelectWorld.java   
public void confirmClicked(boolean par1, int par2)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (par1)
        {
            ISaveFormat var3 = this.mc.getSaveLoader();
            var3.flushCache();
            var3.deleteWorldDirectory(this.func_146621_a(par2));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException var5)
            {
                logger.error("Couldn\'t load level list", var5);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:ExpandedRailsMod    文件:GuiListWorldSelection.java   
public void refreshList()
{
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    List<WorldSummary> list;

    try
    {
        list = isaveformat.getSaveList();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        LOGGER.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    Collections.sort(list);

    for (WorldSummary worldsummary : list)
    {
        this.entries.add(new GuiListWorldSelectionEntry(this, worldsummary, this.mc.getSaveLoader()));
    }
}
项目:Cauldron    文件:SaveFormatOld.java   
@SideOnly(Side.CLIENT)
public List getSaveList() throws AnvilConverterException
{
    ArrayList arraylist = new ArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return arraylist;
}
项目:Cauldron    文件:GuiSelectWorld.java   
public void initGui()
{
    this.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        logger.error("Couldn\'t load level list", anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List();
    this.field_146638_t.registerScrollButtons(4, 5);
    this.func_146618_g();
}
项目:Cauldron    文件:GuiSelectWorld.java   
public void confirmClicked(boolean p_73878_1_, int p_73878_2_)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (p_73878_1_)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.func_146621_a(p_73878_2_));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                logger.error("Couldn\'t load level list", anvilconverterexception);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:Cauldron    文件:SaveFormatOld.java   
@SideOnly(Side.CLIENT)
public List getSaveList() throws AnvilConverterException
{
    ArrayList arraylist = new ArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return arraylist;
}
项目:Cauldron    文件:GuiSelectWorld.java   
public void initGui()
{
    this.field_146628_f = I18n.format("selectWorld.title", new Object[0]);

    try
    {
        this.func_146627_h();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        logger.error("Couldn\'t load level list", anvilconverterexception);
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage()));
        return;
    }

    this.field_146637_u = I18n.format("selectWorld.world", new Object[0]);
    this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]);
    this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]);
    this.field_146638_t = new GuiSelectWorld.List();
    this.field_146638_t.registerScrollButtons(4, 5);
    this.func_146618_g();
}
项目:Cauldron    文件:GuiSelectWorld.java   
public void confirmClicked(boolean p_73878_1_, int p_73878_2_)
{
    if (this.field_146643_x)
    {
        this.field_146643_x = false;

        if (p_73878_1_)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.func_146621_a(p_73878_2_));

            try
            {
                this.func_146627_h();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                logger.error("Couldn\'t load level list", anvilconverterexception);
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
public void func_73866_w_() {
   this.field_74075_b = I18n.func_135053_a("selectWorld.title");

   try {
      this.func_74073_h();
   } catch (AnvilConverterException var2) {
      var2.printStackTrace();
      this.field_73882_e.func_71373_a(new GuiErrorScreen("Unable to load words", var2.getMessage()));
      return;
   }

   this.field_74087_p = I18n.func_135053_a("selectWorld.world");
   this.field_74086_q = I18n.func_135053_a("selectWorld.conversion");
   this.field_74085_r[EnumGameType.SURVIVAL.func_77148_a()] = I18n.func_135053_a("gameMode.survival");
   this.field_74085_r[EnumGameType.CREATIVE.func_77148_a()] = I18n.func_135053_a("gameMode.creative");
   this.field_74085_r[EnumGameType.ADVENTURE.func_77148_a()] = I18n.func_135053_a("gameMode.adventure");
   this.field_74079_o = new GuiWorldSlot(this);
   this.field_74079_o.func_77220_a(4, 5);
   this.func_74065_g();
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
public void func_73878_a(boolean p_73878_1_, int p_73878_2_) {
   if(this.field_74084_s) {
      this.field_74084_s = false;
      if(p_73878_1_) {
         ISaveFormat var3 = this.field_73882_e.func_71359_d();
         var3.func_75800_d();
         var3.func_75802_e(this.func_74069_a(p_73878_2_));

         try {
            this.func_74073_h();
         } catch (AnvilConverterException var5) {
            var5.printStackTrace();
         }
      }

      this.field_73882_e.func_71373_a(this);
   }

}
项目:RuneCraftery    文件:SaveFormatOld.java   
@SideOnly(Side.CLIENT)
public List getSaveList() throws AnvilConverterException
{
    ArrayList arraylist = new ArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return arraylist;
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.screenTitle = I18n.getString("selectWorld.title");

    try
    {
        this.loadSaves();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        anvilconverterexception.printStackTrace();
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load words", anvilconverterexception.getMessage()));
        return;
    }

    this.localizedWorldText = I18n.getString("selectWorld.world");
    this.localizedMustConvertText = I18n.getString("selectWorld.conversion");
    this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival");
    this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative");
    this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure");
    this.worldSlotContainer = new GuiWorldSlot(this);
    this.worldSlotContainer.registerScrollButtons(4, 5);
    this.initButtons();
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
public void confirmClicked(boolean par1, int par2)
{
    if (this.deleting)
    {
        this.deleting = false;

        if (par1)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.getSaveFileName(par2));

            try
            {
                this.loadSaves();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                anvilconverterexception.printStackTrace();
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:BetterNutritionMod    文件:SaveFormatOld.java   
@SideOnly(Side.CLIENT)
public List getSaveList() throws AnvilConverterException
{
    ArrayList arraylist = new ArrayList();

    for (int i = 0; i < 5; ++i)
    {
        String s = "World" + (i + 1);
        WorldInfo worldinfo = this.getWorldInfo(s);

        if (worldinfo != null)
        {
            arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
        }
    }

    return arraylist;
}
项目:BetterNutritionMod    文件:GuiSelectWorld.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.screenTitle = I18n.getString("selectWorld.title");

    try
    {
        this.loadSaves();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        anvilconverterexception.printStackTrace();
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load words", anvilconverterexception.getMessage()));
        return;
    }

    this.localizedWorldText = I18n.getString("selectWorld.world");
    this.localizedMustConvertText = I18n.getString("selectWorld.conversion");
    this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival");
    this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative");
    this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure");
    this.worldSlotContainer = new GuiWorldSlot(this);
    this.worldSlotContainer.registerScrollButtons(4, 5);
    this.initButtons();
}
项目:BetterNutritionMod    文件:GuiSelectWorld.java   
public void confirmClicked(boolean par1, int par2)
{
    if (this.deleting)
    {
        this.deleting = false;

        if (par1)
        {
            ISaveFormat isaveformat = this.mc.getSaveLoader();
            isaveformat.flushCache();
            isaveformat.deleteWorldDirectory(this.getSaveFileName(par2));

            try
            {
                this.loadSaves();
            }
            catch (AnvilConverterException anvilconverterexception)
            {
                anvilconverterexception.printStackTrace();
            }
        }

        this.mc.displayGuiScreen(this);
    }
}
项目:AgeCraft-Old    文件:GuiSelectWorld.java   
public void loadSaveList() throws AnvilConverterException, IllegalAccessException {
    ISaveFormat saveFormat = mc.getSaveLoader();
    java.util.List list = saveFormat.getSaveList();
    ArrayList newList = new ArrayList();
    for(Object obj : list) {
        if(obj instanceof SaveFormatComparator) {
            //SaveFormatComparator comparator = (SaveFormatComparator) obj;
            //if(saveFormat.getWorldInfo(comparator.getFileName()).getNBTTagCompound().hasKey("AgeCraft")) {
                newList.add(obj);
            //}
        }
    }
    Collections.sort(newList);
    super_field_146639_s.set(this, newList);
    super_field_146640_r.setInt(this, -1);
}
项目:DecompiledMinecraft    文件:AnvilSaveConverter.java   
public List<SaveFormatComparator> getSaveList() throws AnvilConverterException
{
    if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory())
    {
        List<SaveFormatComparator> list = Lists.<SaveFormatComparator>newArrayList();
        File[] afile = this.savesDirectory.listFiles();

        for (File file1 : afile)
        {
            if (file1.isDirectory())
            {
                String s = file1.getName();
                WorldInfo worldinfo = this.getWorldInfo(s);

                if (worldinfo != null && (worldinfo.getSaveVersion() == 19132 || worldinfo.getSaveVersion() == 19133))
                {
                    boolean flag = worldinfo.getSaveVersion() != this.getSaveVersion();
                    String s1 = worldinfo.getWorldName();

                    if (StringUtils.isEmpty(s1))
                    {
                        s1 = s;
                    }

                    long i = 0L;
                    list.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), i, worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
                }
            }
        }

        return list;
    }
    else
    {
        throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!");
    }
}
项目:DecompiledMinecraft    文件:RealmsAnvilLevelStorageSource.java   
public List<RealmsLevelSummary> getLevelList() throws AnvilConverterException
{
    List<RealmsLevelSummary> list = Lists.<RealmsLevelSummary>newArrayList();

    for (SaveFormatComparator saveformatcomparator : this.levelStorageSource.getSaveList())
    {
        list.add(new RealmsLevelSummary(saveformatcomparator));
    }

    return list;
}
项目:DecompiledMinecraft    文件:GuiSelectWorld.java   
private void func_146627_h() throws AnvilConverterException
{
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    this.field_146639_s = isaveformat.getSaveList();
    Collections.sort(this.field_146639_s);
    this.field_146640_r = -1;
}
项目:BaseClient    文件:AnvilSaveConverter.java   
public List<SaveFormatComparator> getSaveList() throws AnvilConverterException
{
    if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory())
    {
        List<SaveFormatComparator> list = Lists.<SaveFormatComparator>newArrayList();
        File[] afile = this.savesDirectory.listFiles();

        for (File file1 : afile)
        {
            if (file1.isDirectory())
            {
                String s = file1.getName();
                WorldInfo worldinfo = this.getWorldInfo(s);

                if (worldinfo != null && (worldinfo.getSaveVersion() == 19132 || worldinfo.getSaveVersion() == 19133))
                {
                    boolean flag = worldinfo.getSaveVersion() != this.getSaveVersion();
                    String s1 = worldinfo.getWorldName();

                    if (StringUtils.isEmpty(s1))
                    {
                        s1 = s;
                    }

                    long i = 0L;
                    list.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), i, worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed()));
                }
            }
        }

        return list;
    }
    else
    {
        throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!");
    }
}
项目:BaseClient    文件:RealmsAnvilLevelStorageSource.java   
public List<RealmsLevelSummary> getLevelList() throws AnvilConverterException
{
    List<RealmsLevelSummary> list = Lists.<RealmsLevelSummary>newArrayList();

    for (SaveFormatComparator saveformatcomparator : this.levelStorageSource.getSaveList())
    {
        list.add(new RealmsLevelSummary(saveformatcomparator));
    }

    return list;
}