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