本文整理汇总了Java中net.minecraft.world.storage.SaveFormatComparator类的典型用法代码示例。如果您正苦于以下问题:Java SaveFormatComparator类的具体用法?Java SaveFormatComparator怎么用?Java SaveFormatComparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SaveFormatComparator类属于net.minecraft.world.storage包,在下文中一共展示了SaveFormatComparator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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);
}
示例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);
}
示例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!");
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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!");
}
}
示例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;
}
示例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);
}