當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldInfo.getSaveVersion方法代碼示例

本文整理匯總了Java中net.minecraft.world.storage.WorldInfo.getSaveVersion方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldInfo.getSaveVersion方法的具體用法?Java WorldInfo.getSaveVersion怎麽用?Java WorldInfo.getSaveVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.world.storage.WorldInfo的用法示例。


在下文中一共展示了WorldInfo.getSaveVersion方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSaveList

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的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

示例2: getSaveList

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的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"));
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:38,代碼來源:AnvilSaveConverter.java

示例3: getSaveList

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的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!");
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:39,代碼來源:AnvilSaveConverter.java

示例4: isOldMapFormat

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的package包/類
/**
 * gets if the map is old chunk saving (true) or McRegion (false)
 */
public boolean isOldMapFormat(String saveName)
{
    WorldInfo worldinfo = this.getWorldInfo(saveName);
    return worldinfo != null && worldinfo.getSaveVersion() != this.getSaveVersion();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:9,代碼來源:AnvilSaveConverter.java

示例5: func_154334_a

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的package包/類
public boolean func_154334_a(String saveName)
{
    WorldInfo worldinfo = this.getWorldInfo(saveName);
    return worldinfo != null && worldinfo.getSaveVersion() == 19132;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:AnvilSaveConverter.java

示例6: isConvertible

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的package包/類
public boolean isConvertible(String saveName)
{
    WorldInfo worldinfo = this.getWorldInfo(saveName);
    return worldinfo != null && worldinfo.getSaveVersion() == 19132;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:AnvilSaveConverter.java

示例7: isConvertible

import net.minecraft.world.storage.WorldInfo; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public boolean isConvertible(String saveName)
{
    WorldInfo worldinfo = this.getWorldInfo(saveName);
    return worldinfo != null && worldinfo.getSaveVersion() == 19132;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:7,代碼來源:AnvilSaveConverter.java


注:本文中的net.minecraft.world.storage.WorldInfo.getSaveVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。