本文整理汇总了Java中net.minecraft.world.storage.WorldSummary类的典型用法代码示例。如果您正苦于以下问题:Java WorldSummary类的具体用法?Java WorldSummary怎么用?Java WorldSummary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldSummary类属于net.minecraft.world.storage包,在下文中一共展示了WorldSummary类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GuiListWorldSelectionEntry
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
public GuiListWorldSelectionEntry(GuiListWorldSelection listWorldSelIn, WorldSummary p_i46591_2_, ISaveFormat p_i46591_3_)
{
this.containingListSel = listWorldSelIn;
this.worldSelScreen = listWorldSelIn.getGuiWorldSelection();
this.worldSummary = p_i46591_2_;
this.client = Minecraft.getMinecraft();
this.iconLocation = new ResourceLocation("worlds/" + p_i46591_2_.getFileName() + "/icon");
this.iconFile = p_i46591_3_.getFile(p_i46591_2_.getFileName(), "icon.png");
if (!this.iconFile.isFile())
{
this.iconFile = null;
}
this.loadServerIcon();
}
示例2: refreshList
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
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()));
}
}
示例3: refreshList
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
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()));
}
}
示例4: cleanupTemporaryWorlds
import net.minecraft.world.storage.WorldSummary; //导入依赖的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<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);
}
}
}
示例5: getSaveList
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
public List<WorldSummary> getSaveList() throws AnvilConverterException
{
if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory())
{
List<WorldSummary> list = Lists.<WorldSummary>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 WorldSummary(worldinfo, s, s1, 0L, flag));
}
}
}
return list;
}
else
{
throw new AnvilConverterException(I18n.translateToLocal("selectWorld.load_folder_access"));
}
}
示例6: getLevelList
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
public List<RealmsLevelSummary> getLevelList() throws AnvilConverterException
{
List<RealmsLevelSummary> list = Lists.<RealmsLevelSummary>newArrayList();
for (WorldSummary worldsummary : this.levelStorageSource.getSaveList())
{
list.add(new RealmsLevelSummary(worldsummary));
}
return list;
}
示例7: getSaveList
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public List<WorldSummary> getSaveList() throws AnvilConverterException
{
if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory())
{
List<WorldSummary> list = Lists.<WorldSummary>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 WorldSummary(worldinfo, s, s1, 0L, flag));
}
}
}
return list;
}
else
{
throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!");
}
}
示例8: RealmsLevelSummary
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
public RealmsLevelSummary(WorldSummary levelSummaryIn)
{
this.levelSummary = levelSummaryIn;
}
示例9: compareTo
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
public int compareTo(WorldSummary p_compareTo_1_)
{
return this.levelSummary.compareTo(p_compareTo_1_);
}
示例10: createWorld
import net.minecraft.world.storage.WorldSummary; //导入依赖的package包/类
@Override
public boolean createWorld(MissionInit missionInit)
{
if (this.mapFilename == null || this.mapFilename.length() == 0)
{
this.errorDetails = "No basemap URI provided - check your Mission XML.";
return false;
}
File mapSource = new File(this.mapFilename);
if (!mapSource.exists())
{
this.errorDetails = "Basemap file " + this.mapFilename + " was not found - check your Mission XML and ensure the file exists on the Minecraft client machine.";
return false;
}
if (!mapSource.isDirectory())
{
this.errorDetails = "Basemap location " + this.mapFilename + " needs to be a folder. Check the path in your Mission XML.";
return false;
}
File mapCopy = MapFileHelper.copyMapFiles(mapSource, this.fwparams.isDestroyAfterUse());
if (mapCopy == null)
{
this.errorDetails = "Unable to copy " + this.mapFilename + " - is the hard drive full?";
return false;
}
if (!Minecraft.getMinecraft().getSaveLoader().canLoadWorld(mapCopy.getName()))
{
this.errorDetails = "Minecraft is unable to load " + this.mapFilename + " - is it a valid saved world?";
return false;
}
ISaveFormat isaveformat = Minecraft.getMinecraft().getSaveLoader();
List<WorldSummary> worldlist;
try
{
worldlist = isaveformat.getSaveList();
}
catch (AnvilConverterException anvilconverterexception)
{
this.errorDetails = "Minecraft couldn't rebuild saved world list.";
return false;
}
WorldSummary newWorld = null;
for (WorldSummary ws : worldlist)
{
if (ws.getFileName().equals(mapCopy.getName()))
newWorld = ws;
}
if (newWorld == null)
{
this.errorDetails = "Minecraft could not find the copied world.";
return false;
}
net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(null, newWorld);
IntegratedServer server = Minecraft.getMinecraft().getIntegratedServer();
String worldName = (server != null) ? server.getWorldName() : null;
if (worldName == null || !worldName.equals(newWorld.getDisplayName()))
{
this.errorDetails = "Minecraft could not load " + this.mapFilename + " - is it a valid saved world?";
return false;
}
MapFileHelper.cleanupTemporaryWorlds(mapCopy.getName()); // Now we are safely running a new file, we can attempt to clean up old ones.
return true;
}