• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SaveFormatComparator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cleanupTemporaryWorlds

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:26,代码来源:MapFileHelper.java


示例2: reloadSaves

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
public static void reloadSaves() {
    File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/local");
    if (!saveDir.exists())
        return;

    List<SaveFormatComparator> saves;
    try {
        saves = Minecraft.getMinecraft().getSaveLoader().getSaveList();
    } catch (Exception e) {
        logger.error("Error loading saves", e);
        return;
    }
    HashSet<String> saveFileNames = new HashSet<String>();
    for (SaveFormatComparator save : saves)
        saveFileNames.add(save.getFileName());

    for (File file : saveDir.listFiles())
        if (file.isDirectory() && !saveFileNames.contains(file.getName()))
            ObfuscationRun.deleteDir(file, true);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:NEIClientConfig.java


示例3: loadSaveList

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
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);
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:17,代码来源:GuiSelectWorld.java


示例4: getSaveList

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
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!");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:38,代码来源:AnvilSaveConverter.java


示例5: getLevelList

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:RealmsAnvilLevelStorageSource.java


示例6: func_146614_d

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected String func_146614_d(int p_146614_1_)
{
    String s = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName();

    if (StringUtils.isEmpty(s))
    {
        s = I18n.format("selectWorld.world", new Object[0]) + " " + (p_146614_1_ + 1);
    }

    return s;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:GuiSelectWorld.java


示例7: drawSlot

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn)
{
    SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(entryID);
    String s = saveformatcomparator.getDisplayName();

    if (StringUtils.isEmpty(s))
    {
        s = GuiSelectWorld.this.field_146637_u + " " + (entryID + 1);
    }

    String s1 = saveformatcomparator.getFileName();
    s1 = s1 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed()));
    s1 = s1 + ")";
    String s2 = "";

    if (saveformatcomparator.requiresConversion())
    {
        s2 = GuiSelectWorld.this.field_146636_v + " " + s2;
    }
    else
    {
        s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()];

        if (saveformatcomparator.isHardcoreModeEnabled())
        {
            s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET;
        }

        if (saveformatcomparator.getCheatsEnabled())
        {
            s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]);
        }
    }

    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, p_180791_2_ + 2, p_180791_3_ + 1, 16777215);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 12, 8421504);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 12 + 10, 8421504);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:39,代码来源:GuiSelectWorld.java


示例8: func_146614_d

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected String func_146614_d(int p_146614_1_)
{
    String var2 = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName();

    if (var2 == null || MathHelper.stringNullOrLengthZero(var2))
    {
        var2 = I18n.format("selectWorld.world", new Object[0]) + " " + (p_146614_1_ + 1);
    }

    return var2;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:GuiSelectWorld.java


示例9: drawSlot

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_)
{
    SaveFormatComparator var8 = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(p_148126_1_);
    String var9 = var8.getDisplayName();

    if (var9 == null || MathHelper.stringNullOrLengthZero(var9))
    {
        var9 = GuiSelectWorld.this.field_146637_u + " " + (p_148126_1_ + 1);
    }

    String var10 = var8.getFileName();
    var10 = var10 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(var8.getLastTimePlayed()));
    var10 = var10 + ")";
    String var11 = "";

    if (var8.requiresConversion())
    {
        var11 = GuiSelectWorld.this.field_146636_v + " " + var11;
    }
    else
    {
        var11 = GuiSelectWorld.this.field_146635_w[var8.getEnumGameType().getID()];

        if (var8.isHardcoreModeEnabled())
        {
            var11 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET;
        }

        if (var8.getCheatsEnabled())
        {
            var11 = var11 + ", " + I18n.format("selectWorld.cheats", new Object[0]);
        }
    }

    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var9, p_148126_2_ + 2, p_148126_3_ + 1, 16777215);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var10, p_148126_2_ + 2, p_148126_3_ + 12, 8421504);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var11, p_148126_2_ + 2, p_148126_3_ + 12 + 10, 8421504);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:39,代码来源:GuiSelectWorld.java


示例10: getLevelList

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
public List getLevelList() throws AnvilConverterException
{
    ArrayList arraylist = new ArrayList();
    Iterator iterator = this.levelStorageSource.getSaveList().iterator();

    while (iterator.hasNext())
    {
        SaveFormatComparator saveformatcomparator = (SaveFormatComparator)iterator.next();
        arraylist.add(new RealmsLevelSummary(saveformatcomparator));
    }

    return arraylist;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:14,代码来源:RealmsAnvilLevelStorageSource.java


示例11: func_146614_d

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected String func_146614_d(int p_146614_1_)
{
    String s = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s))
    {
        s = I18n.format("selectWorld.world", new Object[0]) + " " + (p_146614_1_ + 1);
    }

    return s;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:GuiSelectWorld.java


示例12: drawSlot

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_)
{
    SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(p_148126_1_);
    String s = saveformatcomparator.getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s))
    {
        s = GuiSelectWorld.this.field_146637_u + " " + (p_148126_1_ + 1);
    }

    String s1 = saveformatcomparator.getFileName();
    s1 = s1 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed()));
    s1 = s1 + ")";
    String s2 = "";

    if (saveformatcomparator.requiresConversion())
    {
        s2 = GuiSelectWorld.this.field_146636_v + " " + s2;
    }
    else
    {
        s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()];

        if (saveformatcomparator.isHardcoreModeEnabled())
        {
            s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET;
        }

        if (saveformatcomparator.getCheatsEnabled())
        {
            s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]);
        }
    }

    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, p_148126_2_ + 2, p_148126_3_ + 1, 16777215);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, p_148126_2_ + 2, p_148126_3_ + 12, 8421504);
    GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, p_148126_2_ + 2, p_148126_3_ + 12 + 10, 8421504);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:39,代码来源:GuiSelectWorld.java


示例13: func_75799_b

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public List func_75799_b() throws AnvilConverterException {
   if(this.field_75808_a != null && this.field_75808_a.exists() && this.field_75808_a.isDirectory()) {
      ArrayList var1 = new ArrayList();
      File[] var2 = this.field_75808_a.listFiles();
      File[] var3 = var2;
      int var4 = var2.length;

      for(int var5 = 0; var5 < var4; ++var5) {
         File var6 = var3[var5];
         if(var6.isDirectory()) {
            String var7 = var6.getName();
            WorldInfo var8 = this.func_75803_c(var7);
            if(var8 != null && (var8.func_76088_k() == 19132 || var8.func_76088_k() == 19133)) {
               boolean var9 = var8.func_76088_k() != this.func_75812_c();
               String var10 = var8.func_76065_j();
               if(var10 == null || MathHelper.func_76139_a(var10)) {
                  var10 = var7;
               }

               long var11 = 0L;
               var1.add(new SaveFormatComparator(var7, var10, var8.func_76057_l(), var11, var8.func_76077_q(), var9, var8.func_76093_s(), var8.func_76086_u()));
            }
         }
      }

      return var1;
   } else {
      throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!");
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:32,代码来源:AnvilSaveConverter.java


示例14: func_75799_b

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public List func_75799_b() throws AnvilConverterException {
   ArrayList var1 = new ArrayList();

   for(int var2 = 0; var2 < 5; ++var2) {
      String var3 = "World" + (var2 + 1);
      WorldInfo var4 = this.func_75803_c(var3);
      if(var4 != null) {
         var1.add(new SaveFormatComparator(var3, "", var4.func_76057_l(), var4.func_76092_g(), var4.func_76077_q(), false, var4.func_76093_s(), var4.func_76086_u()));
      }
   }

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


示例15: func_77214_a

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected void func_77214_a(int p_77214_1_, int p_77214_2_, int p_77214_3_, int p_77214_4_, Tessellator p_77214_5_) {
   SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.func_74068_a(this.field_77254_a).get(p_77214_1_);
   String var7 = var6.func_75788_b();
   if(var7 == null || MathHelper.func_76139_a(var7)) {
      var7 = GuiSelectWorld.func_82313_g(this.field_77254_a) + " " + (p_77214_1_ + 1);
   }

   String var8 = var6.func_75786_a();
   var8 = var8 + " (" + GuiSelectWorld.func_82315_h(this.field_77254_a).format(new Date(var6.func_75784_e()));
   var8 = var8 + ")";
   String var9 = "";
   if(var6.func_75785_d()) {
      var9 = GuiSelectWorld.func_82311_i(this.field_77254_a) + " " + var9;
   } else {
      var9 = GuiSelectWorld.func_82314_j(this.field_77254_a)[var6.func_75790_f().func_77148_a()];
      if(var6.func_75789_g()) {
         var9 = EnumChatFormatting.DARK_RED + I18n.func_135053_a("gameMode.hardcore") + EnumChatFormatting.RESET;
      }

      if(var6.func_75783_h()) {
         var9 = var9 + ", " + I18n.func_135053_a("selectWorld.cheats");
      }
   }

   this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var7, p_77214_2_ + 2, p_77214_3_ + 1, 16777215);
   this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var8, p_77214_2_ + 2, p_77214_3_ + 12, 8421504);
   this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var9, p_77214_2_ + 2, p_77214_3_ + 12 + 10, 8421504);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:GuiWorldSlot.java


示例16: func_74063_d

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected String func_74063_d(int p_74063_1_) {
   String var2 = ((SaveFormatComparator)this.field_74078_n.get(p_74063_1_)).func_75788_b();
   if(var2 == null || MathHelper.func_76139_a(var2)) {
      var2 = I18n.func_135053_a("selectWorld.world") + " " + (p_74063_1_ + 1);
   }

   return var2;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:GuiSelectWorld.java


示例17: drawSlot

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
{
    SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(par1);
    String s = saveformatcomparator.getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s))
    {
        s = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (par1 + 1);
    }

    String s1 = saveformatcomparator.getFileName();
    s1 = s1 + " (" + GuiSelectWorld.func_82315_h(this.parentWorldGui).format(new Date(saveformatcomparator.getLastTimePlayed()));
    s1 = s1 + ")";
    String s2 = "";

    if (saveformatcomparator.requiresConversion())
    {
        s2 = GuiSelectWorld.func_82311_i(this.parentWorldGui) + " " + s2;
    }
    else
    {
        s2 = GuiSelectWorld.func_82314_j(this.parentWorldGui)[saveformatcomparator.getEnumGameType().getID()];

        if (saveformatcomparator.isHardcoreModeEnabled())
        {
            s2 = EnumChatFormatting.DARK_RED + I18n.getString("gameMode.hardcore") + EnumChatFormatting.RESET;
        }

        if (saveformatcomparator.getCheatsEnabled())
        {
            s2 = s2 + ", " + I18n.getString("selectWorld.cheats");
        }
    }

    this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, s, par2 + 2, par3 + 1, 16777215);
    this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, s1, par2 + 2, par3 + 12, 8421504);
    this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, s2, par2 + 2, par3 + 12 + 10, 8421504);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:39,代码来源:GuiWorldSlot.java


示例18: getSaveName

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
/**
 * returns the name of the saved game
 */
protected String getSaveName(int par1)
{
    String s = ((SaveFormatComparator)this.saveList.get(par1)).getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s))
    {
        s = I18n.getString("selectWorld.world") + " " + (par1 + 1);
    }

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


示例19: getSaveFileName

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
protected String getSaveFileName(int i) {
    if (saveList.size() < i + 1) {
        return null;
    } else {
        return ((SaveFormatComparator) saveList.get(i)).getFileName();
    }
}
 
开发者ID:arilotter,项目名称:SimpleMenu,代码行数:8,代码来源:WorldLoader.java


示例20: getSaveName

import net.minecraft.world.storage.SaveFormatComparator; //导入依赖的package包/类
/**
 * returns the name of the saved game
 */
protected String getSaveName(int par1) {
    String s = ((SaveFormatComparator) this.saveList.get(par1)).getDisplayName();

    if (s == null || MathHelper.stringNullOrLengthZero(s)) {
        s = I18n.func_135053_a("selectWorld.world") + " " + (par1 + 1);
    }

    return s;
}
 
开发者ID:arilotter,项目名称:SimpleMenu,代码行数:13,代码来源:WorldLoader.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransducerEvaluator类代码示例发布时间:2022-05-22
下一篇:
Java RequestEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap