当前位置: 首页>>代码示例>>Java>>正文


Java ISaveHandler.loadWorldInfo方法代码示例

本文整理汇总了Java中net.minecraft.world.storage.ISaveHandler.loadWorldInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ISaveHandler.loadWorldInfo方法的具体用法?Java ISaveHandler.loadWorldInfo怎么用?Java ISaveHandler.loadWorldInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.storage.ISaveHandler的用法示例。


在下文中一共展示了ISaveHandler.loadWorldInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
	if(button.id == 3) {
		mc.displayGuiScreen(new GuiCreateWorld(this));
	} else if(button.id == 7) {
		try {
			GuiCreateWorld gui = new GuiCreateWorld(this);
			ISaveHandler saveHandler = mc.getSaveLoader().getSaveLoader(func_146621_a(super_field_146640_r.getInt(this)), false);
			WorldInfo worldInfo = saveHandler.loadWorldInfo();
			saveHandler.flush();
			gui.func_146318_a(worldInfo);
			mc.displayGuiScreen(gui);
		} catch(Exception e) {
			e.printStackTrace();
		}
	} else {
		super.actionPerformed(button);
	}
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:20,代码来源:GuiSelectWorld.java

示例2: recreateWorld

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public void recreateWorld()
{
    this.client.displayGuiScreen(new GuiScreenWorking());
    GuiCreateWorld guicreateworld = new GuiCreateWorld(this.worldSelScreen);
    ISaveHandler isavehandler = this.client.getSaveLoader().getSaveLoader(this.worldSummary.getFileName(), false);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();
    isavehandler.flush();

    if (worldinfo != null)
    {
        guicreateworld.recreateFromExistingWorld(worldinfo);
        this.client.displayGuiScreen(guicreateworld);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:GuiListWorldSelectionEntry.java

示例3: recreateWorld

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public void recreateWorld()
{
    this.client.displayGuiScreen(new GuiScreenWorking());
    GuiCreateWorld guicreateworld = new GuiCreateWorld(this.worldSelScreen);
    ISaveHandler isavehandler = this.client.getSaveLoader().getSaveLoader(this.worldSummary.getFileName(), false);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();
    isavehandler.flush();
    guicreateworld.recreateFromExistingWorld(worldinfo);
    this.client.displayGuiScreen(guicreateworld);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:GuiListWorldSelectionEntry.java

示例4: initWorld

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public void initWorld(int dimension, WorldContext ctx){
    if(!this.dimensions.contains(dimension) && !this.customProviders.containsKey(dimension)){
        throw new IllegalArgumentException(String.format("Provider type for dimension %d does not exist!", dimension));
    }
    MinecraftServer mcserver = MinecraftServer.getServer();
    String name = ctx.getName() + "/" + ctx.getSubName();
    ISaveHandler saveHandler = mcserver.getActiveAnvilConverter().getSaveLoader(name, true);
    WorldInfo worldInfo = saveHandler.loadWorldInfo(); //Attempt to load level.dat

    WorldSettings worldSettings;

    if(worldInfo == null){ //If the level.dat does not exist, create a new one
        //TODO: populate this from the mappack that may or may not exist
        //Arguments: seed, gameType, enable structures, hardcore mode, worldType
        worldSettings = new WorldSettings(0, WorldSettings.GameType.ADVENTURE, false, false, WorldType.DEFAULT);
        worldSettings.setWorldName(""); //Generator settings (for flat)
        worldInfo = new WorldInfo(worldSettings, name);
    }else{
        worldSettings = new WorldSettings(worldInfo);
    }

    worldContext.put(dimension, ctx);
    WorldServer world = new WorldServer(mcserver, saveHandler, worldInfo, dimension, mcserver.theProfiler);
    world.init();
    world.addWorldAccess(new WorldManager(mcserver, world));
    NailedEventFactory.fireWorldLoad(world);
    world.getWorldInfo().setGameType(mcserver.getGameType());
}
 
开发者ID:nailed,项目名称:nailed,代码行数:29,代码来源:NailedDimensionManager.java

示例5: launchIntegratedServer

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
/**
 * Arguments: World foldername,  World ingame name, WorldSettings
 */
public void launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings)
{
    this.loadWorld((WorldClient)null);
    System.gc();
    ISaveHandler isavehandler = this.saveLoader.getSaveLoader(par1Str, false);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();

    if (worldinfo == null && par3WorldSettings != null)
    {
        worldinfo = new WorldInfo(par3WorldSettings, par1Str);
        isavehandler.saveWorldInfo(worldinfo);
    }

    if (par3WorldSettings == null)
    {
        par3WorldSettings = new WorldSettings(worldinfo);
    }

    this.statFileWriter.readStat(StatList.startGameStat, 1);

    GameData.initializeServerGate(2);

    this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings);
    this.theIntegratedServer.startServerThread();

    MapDifference<Integer, ItemData> idDifferences = GameData.gateWorldLoadingForValidation();
    if (idDifferences!=null)
    {
        FMLClientHandler.instance().warnIDMismatch(idDifferences, true);
    }
    else
    {
        GameData.releaseGate(true);
        continueWorldLoading();
    }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:41,代码来源:Minecraft.java

示例6: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 2)
        {
            String s = this.func_146614_d(this.field_146640_r);

            if (s != null)
            {
                this.field_146643_x = true;
                GuiYesNo guiyesno = func_152129_a(this, s, this.field_146640_r);
                this.mc.displayGuiScreen(guiyesno);
            }
        }
        else if (button.id == 1)
        {
            this.func_146615_e(this.field_146640_r);
        }
        else if (button.id == 3)
        {
            this.mc.displayGuiScreen(new GuiCreateWorld(this));
        }
        else if (button.id == 6)
        {
            this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r)));
        }
        else if (button.id == 0)
        {
            this.mc.displayGuiScreen(this.parentScreen);
        }
        else if (button.id == 7)
        {
            GuiCreateWorld guicreateworld = new GuiCreateWorld(this);
            ISaveHandler isavehandler = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.field_146640_r), false);
            WorldInfo worldinfo = isavehandler.loadWorldInfo();
            isavehandler.flush();
            guicreateworld.func_146318_a(worldinfo);
            this.mc.displayGuiScreen(guicreateworld);
        }
        else
        {
            this.field_146638_t.actionPerformed(button);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:50,代码来源:GuiSelectWorld.java

示例7: World

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public World(ISaveHandler p_i45369_1_, String p_i45369_2_, WorldSettings p_i45369_3_, WorldProvider p_i45369_4_, Profiler p_i45369_5_)
{
    this.ambientTickCountdown = this.rand.nextInt(12000);
    this.spawnHostileMobs = true;
    this.spawnPeacefulMobs = true;
    this.collidingBoundingBoxes = new ArrayList();
    this.lightUpdateBlockList = new int[32768];
    this.saveHandler = p_i45369_1_;
    this.theProfiler = p_i45369_5_;
    this.mapStorage = new MapStorage(p_i45369_1_);
    this.worldInfo = p_i45369_1_.loadWorldInfo();

    if (p_i45369_4_ != null)
    {
        this.provider = p_i45369_4_;
    }
    else if (this.worldInfo != null && this.worldInfo.getVanillaDimension() != 0)
    {
        this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getVanillaDimension());
    }
    else
    {
        this.provider = WorldProvider.getProviderForDimension(0);
    }

    if (this.worldInfo == null)
    {
        this.worldInfo = new WorldInfo(p_i45369_3_, p_i45369_2_);
    }
    else
    {
        this.worldInfo.setWorldName(p_i45369_2_);
    }

    this.provider.registerWorld(this);
    this.chunkProvider = this.createChunkProvider();

    if (!this.worldInfo.isInitialized())
    {
        try
        {
            this.initialize(p_i45369_3_);
        }
        catch (Throwable var10)
        {
            CrashReport var7 = CrashReport.makeCrashReport(var10, "Exception initializing level");

            try
            {
                this.addWorldInfoToCrashReport(var7);
            }
            catch (Throwable var9)
            {
                ;
            }

            throw new ReportedException(var7);
        }

        this.worldInfo.setServerInitialized(true);
    }

    VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");

    if (var6 == null)
    {
        this.villageCollectionObj = new VillageCollection(this);
        this.mapStorage.setData("villages", this.villageCollectionObj);
    }
    else
    {
        this.villageCollectionObj = var6;
        this.villageCollectionObj.func_82566_a(this);
    }

    this.calculateInitialSkylight();
    this.calculateInitialWeather();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:79,代码来源:World.java

示例8: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
protected void actionPerformed(GuiButton p_146284_1_)
{
    if (p_146284_1_.enabled)
    {
        if (p_146284_1_.id == 2)
        {
            String var2 = this.func_146614_d(this.field_146640_r);

            if (var2 != null)
            {
                this.field_146643_x = true;
                GuiYesNo var3 = func_146623_a(this, var2, this.field_146640_r);
                this.mc.displayGuiScreen(var3);
            }
        }
        else if (p_146284_1_.id == 1)
        {
            this.func_146615_e(this.field_146640_r);
        }
        else if (p_146284_1_.id == 3)
        {
            this.mc.displayGuiScreen(new GuiCreateWorld(this));
        }
        else if (p_146284_1_.id == 6)
        {
            this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r)));
        }
        else if (p_146284_1_.id == 0)
        {
            this.mc.displayGuiScreen(this.field_146632_a);
        }
        else if (p_146284_1_.id == 7)
        {
            GuiCreateWorld var5 = new GuiCreateWorld(this);
            ISaveHandler var6 = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.field_146640_r), false);
            WorldInfo var4 = var6.loadWorldInfo();
            var6.flush();
            var5.func_146318_a(var4);
            this.mc.displayGuiScreen(var5);
        }
        else
        {
            this.field_146638_t.func_148147_a(p_146284_1_);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:47,代码来源:GuiSelectWorld.java

示例9: launchIntegratedServer

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
/**
 * Arguments: World foldername,  World ingame name, WorldSettings
 */
public void launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings)
{
    this.loadWorld((WorldClient)null);
    System.gc();
    ISaveHandler var4 = this.saveLoader.getSaveLoader(par1Str, false);
    WorldInfo var5 = var4.loadWorldInfo();

    if (var5 == null && par3WorldSettings != null)
    {
        var5 = new WorldInfo(par3WorldSettings, par1Str);
        var4.saveWorldInfo(var5);
    }

    if (par3WorldSettings == null)
    {
        par3WorldSettings = new WorldSettings(var5);
    }

    try
    {
        this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings);
        this.theIntegratedServer.startServerThread();
        this.integratedServerIsRunning = true;
    }
    catch (Throwable var10)
    {
        CrashReport var7 = CrashReport.makeCrashReport(var10, "Starting integrated server");
        CrashReportCategory var8 = var7.makeCategory("Starting integrated server");
        var8.addCrashSection("Level ID", par1Str);
        var8.addCrashSection("Level Name", par2Str);
        throw new ReportedException(var7);
    }

    this.loadingScreen.displayProgressMessage(I18n.format("menu.loadingLevel", new Object[0]));

    while (!this.theIntegratedServer.serverIsInRunLoop())
    {
        String var6 = this.theIntegratedServer.getUserMessage();

        if (var6 != null)
        {
            this.loadingScreen.resetProgresAndWorkingMessage(I18n.format(var6, new Object[0]));
        }
        else
        {
            this.loadingScreen.resetProgresAndWorkingMessage("");
        }

        try
        {
            Thread.sleep(200L);
        }
        catch (InterruptedException var9)
        {
            ;
        }
    }

    this.displayGuiScreen((GuiScreen)null);
    SocketAddress var11 = this.theIntegratedServer.func_147137_ag().addLocalEndpoint();
    NetworkManager var12 = NetworkManager.provideLocalClient(var11);
    var12.setNetHandler(new NetHandlerLoginClient(var12, this, (GuiScreen)null));
    var12.scheduleOutboundPacket(new C00Handshake(4, var11.toString(), 0, EnumConnectionState.LOGIN), new GenericFutureListener[0]);
    var12.scheduleOutboundPacket(new C00PacketLoginStart(this.getSession().func_148256_e()), new GenericFutureListener[0]);
    this.myNetworkManager = var12;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:70,代码来源:Minecraft.java

示例10: loadAllWorlds

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
    this.convertMapIfNeeded(par1Str);
    this.setUserMessage("menu.loadingLevel");
    this.worldServers = new WorldServer[3];
    this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
    ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
    WorldInfo var9 = var7.loadWorldInfo();
    WorldSettings var8;

    if (var9 == null)
    {
        var8 = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType);
        var8.func_82750_a(par6Str);
    }
    else
    {
        var8 = new WorldSettings(var9);
    }

    if (this.enableBonusChest)
    {
        var8.enableBonusChest();
    }

    for (int var10 = 0; var10 < this.worldServers.length; ++var10)
    {
        byte var11 = 0;

        if (var10 == 1)
        {
            var11 = -1;
        }

        if (var10 == 2)
        {
            var11 = 1;
        }

        if (var10 == 0)
        {
            if (this.isDemo())
            {
                this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler);
            }
            else
            {
                this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler);
            }
        }
        else
        {
            this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler);
        }

        this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10]));

        if (!this.isSinglePlayer())
        {
            this.worldServers[var10].getWorldInfo().setGameType(this.getGameType());
        }

        this.serverConfigManager.setPlayerManager(this.worldServers);
    }

    this.func_147139_a(this.func_147135_j());
    this.initialWorldChunkLoad();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:69,代码来源:MinecraftServer.java

示例11: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
protected void actionPerformed(GuiButton p_146284_1_)
{
    if (p_146284_1_.enabled)
    {
        if (p_146284_1_.id == 2)
        {
            String s = this.func_146614_d(this.field_146640_r);

            if (s != null)
            {
                this.field_146643_x = true;
                GuiYesNo guiyesno = func_152129_a(this, s, this.field_146640_r);
                this.mc.displayGuiScreen(guiyesno);
            }
        }
        else if (p_146284_1_.id == 1)
        {
            this.func_146615_e(this.field_146640_r);
        }
        else if (p_146284_1_.id == 3)
        {
            this.mc.displayGuiScreen(new GuiCreateWorld(this));
        }
        else if (p_146284_1_.id == 6)
        {
            this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r)));
        }
        else if (p_146284_1_.id == 0)
        {
            this.mc.displayGuiScreen(this.field_146632_a);
        }
        else if (p_146284_1_.id == 7)
        {
            GuiCreateWorld guicreateworld = new GuiCreateWorld(this);
            ISaveHandler isavehandler = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.field_146640_r), false);
            WorldInfo worldinfo = isavehandler.loadWorldInfo();
            isavehandler.flush();
            guicreateworld.func_146318_a(worldinfo);
            this.mc.displayGuiScreen(guicreateworld);
        }
        else
        {
            this.field_146638_t.actionPerformed(p_146284_1_);
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:47,代码来源:GuiSelectWorld.java

示例12: launchIntegratedServer

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public void launchIntegratedServer(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_)
{
    FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_);
    this.loadWorld((WorldClient)null);
    System.gc();
    ISaveHandler isavehandler = this.saveLoader.getSaveLoader(p_71371_1_, false);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();

    if (worldinfo == null && p_71371_3_ != null)
    {
        worldinfo = new WorldInfo(p_71371_3_, p_71371_1_);
        isavehandler.saveWorldInfo(worldinfo);
    }

    if (p_71371_3_ == null)
    {
        p_71371_3_ = new WorldSettings(worldinfo);
    }

    try
    {
        this.theIntegratedServer = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_);
        this.theIntegratedServer.startServerThread();
        this.integratedServerIsRunning = true;
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Starting integrated server");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Starting integrated server");
        crashreportcategory.addCrashSection("Level ID", p_71371_1_);
        crashreportcategory.addCrashSection("Level Name", p_71371_2_);
        throw new ReportedException(crashreport);
    }

    this.loadingScreen.displayProgressMessage(I18n.format("menu.loadingLevel", new Object[0]));

    while (!this.theIntegratedServer.serverIsInRunLoop())
    {
        if (!StartupQuery.check())
        {
            loadWorld(null);
            displayGuiScreen(null);
            return;
        }
        String s2 = this.theIntegratedServer.getUserMessage();

        if (s2 != null)
        {
            this.loadingScreen.resetProgresAndWorkingMessage(I18n.format(s2, new Object[0]));
        }
        else
        {
            this.loadingScreen.resetProgresAndWorkingMessage("");
        }

        try
        {
            Thread.sleep(200L);
        }
        catch (InterruptedException interruptedexception)
        {
            ;
        }
    }

    this.displayGuiScreen((GuiScreen)null);
    SocketAddress socketaddress = this.theIntegratedServer.func_147137_ag().addLocalEndpoint();
    NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
    networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
    networkmanager.scheduleOutboundPacket(new C00Handshake(5, socketaddress.toString(), 0, EnumConnectionState.LOGIN), new GenericFutureListener[0]);
    networkmanager.scheduleOutboundPacket(new C00PacketLoginStart(this.getSession().func_148256_e()), new GenericFutureListener[0]);
    this.myNetworkManager = networkmanager;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:74,代码来源:Minecraft.java

示例13: loadAllWorlds

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_)
{
    this.convertMapIfNeeded(p_71247_1_);
    this.setUserMessage("menu.loadingLevel");
    ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();
    WorldSettings worldsettings;

    if (worldinfo == null)
    {
        worldsettings = new WorldSettings(p_71247_3_, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), p_71247_5_);
        worldsettings.func_82750_a(p_71247_6_);
    }
    else
    {
        worldsettings = new WorldSettings(worldinfo);
    }

    if (this.enableBonusChest)
    {
        worldsettings.enableBonusChest();
    }

    WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, worldsettings, theProfiler));
    for (int dim : DimensionManager.getStaticDimensionIDs())
    {
        WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, worldsettings, overWorld, theProfiler));
        world.addWorldAccess(new WorldManager(this, world));

        if (!this.isSinglePlayer())
        {
            world.getWorldInfo().setGameType(this.getGameType());
        }

        MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
    }

    this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld });
    this.func_147139_a(this.func_147135_j());
    this.initialWorldChunkLoad();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:42,代码来源:MinecraftServer.java

示例14: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
/**
 * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
 */
protected void actionPerformed(GuiButton par1GuiButton)
{
    if (par1GuiButton.enabled)
    {
        if (par1GuiButton.id == 2)
        {
            String s = this.getSaveName(this.selectedWorld);

            if (s != null)
            {
                this.deleting = true;
                GuiYesNo guiyesno = getDeleteWorldScreen(this, s, this.selectedWorld);
                this.mc.displayGuiScreen(guiyesno);
            }
        }
        else if (par1GuiButton.id == 1)
        {
            this.selectWorld(this.selectedWorld);
        }
        else if (par1GuiButton.id == 3)
        {
            this.mc.displayGuiScreen(new GuiCreateWorld(this));
        }
        else if (par1GuiButton.id == 6)
        {
            this.mc.displayGuiScreen(new GuiRenameWorld(this, this.getSaveFileName(this.selectedWorld)));
        }
        else if (par1GuiButton.id == 0)
        {
            this.mc.displayGuiScreen(this.parentScreen);
        }
        else if (par1GuiButton.id == 7)
        {
            GuiCreateWorld guicreateworld = new GuiCreateWorld(this);
            ISaveHandler isavehandler = this.mc.getSaveLoader().getSaveLoader(this.getSaveFileName(this.selectedWorld), false);
            WorldInfo worldinfo = isavehandler.loadWorldInfo();
            isavehandler.flush();
            guicreateworld.func_82286_a(worldinfo);
            this.mc.displayGuiScreen(guicreateworld);
        }
        else
        {
            this.worldSlotContainer.actionPerformed(par1GuiButton);
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:50,代码来源:GuiSelectWorld.java

示例15: loadAllWorlds

import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
    this.convertMapIfNeeded(par1Str);
    this.setUserMessage("menu.loadingLevel");
    ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();
    WorldSettings worldsettings;

    if (worldinfo == null)
    {
        worldsettings = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType);
        worldsettings.func_82750_a(par6Str);
    }
    else
    {
        worldsettings = new WorldSettings(worldinfo);
    }

    if (this.enableBonusChest)
    {
        worldsettings.enableBonusChest();
    }

    WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler, getLogAgent()));
    for (int dim : DimensionManager.getStaticDimensionIDs())
    {
        WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler, getLogAgent()));
        world.addWorldAccess(new WorldManager(this, world));

        if (!this.isSinglePlayer())
        {
            world.getWorldInfo().setGameType(this.getGameType());
        }

        this.serverConfigManager.setPlayerManager(this.worldServers);

        MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
    }

    this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld });
    this.setDifficultyForAllWorlds(this.getDifficulty());
    this.initialWorldChunkLoad();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:44,代码来源:MinecraftServer.java


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