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


Java WorldProvider.getSaveFolder方法代码示例

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


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

示例1: getChunkLoader

import net.minecraft.world.WorldProvider; //导入方法依赖的package包/类
/**
 * initializes and returns the chunk loader for the specified world provider
 */
public IChunkLoader getChunkLoader(WorldProvider provider)
{
    File file1 = this.getWorldDirectory();

    if (provider.getSaveFolder() != null)
    {
        File file3 = new File(file1, provider.getSaveFolder());
        file3.mkdirs();
        return new AnvilChunkLoader(file3, this.dataFixer);
    }
    else
    {
        return new AnvilChunkLoader(file1, this.dataFixer);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:AnvilSaveHandler.java

示例2: getChunkLoader

import net.minecraft.world.WorldProvider; //导入方法依赖的package包/类
public IChunkLoader getChunkLoader(WorldProvider p_75763_1_)
{
    File file1 = this.getWorldDirectory();
    File file2;

    if (p_75763_1_.getSaveFolder() != null)
    {
        file2 = new File(file1, p_75763_1_.getSaveFolder());
        file2.mkdirs();
        return new AnvilChunkLoader(file2);
    }
    else
    {
        return new AnvilChunkLoader(file1);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:17,代码来源:AnvilSaveHandler.java

示例3: getChunkLoader

import net.minecraft.world.WorldProvider; //导入方法依赖的package包/类
/**
 * Returns the chunk loader with the provided world provider
 */
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
{
    File file1 = this.getWorldDirectory();
    File file2;

    if (par1WorldProvider.getSaveFolder() != null)
    {
        file2 = new File(file1, par1WorldProvider.getSaveFolder());
        file2.mkdirs();
        return new AnvilChunkLoader(file2);
    }
    else
    {
        return new AnvilChunkLoader(file1);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:20,代码来源:AnvilSaveHandler.java

示例4: getSaveFile

import net.minecraft.world.WorldProvider; //导入方法依赖的package包/类
/**
 * Manages the path for saving and loading migration data
 * 
 * @param provider
 *            the world provider for the modelled world
 * @return the save file
 */
private static File getSaveFile(WorldProvider provider) {
	File f = new File("saves/" + provider.getSaveFolder() + "/migration/migration.data");
	if (!f.exists()) {
		f.mkdirs();
		try {
			f.createNewFile();
		} catch (Exception e) {

		}
	}
	return f;
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:20,代码来源:FileHandling.java

示例5: initDimension

import net.minecraft.world.WorldProvider; //导入方法依赖的package包/类
public static void initDimension(int dim) {
    if (dim == 0) return; // Cauldron - overworld
    WorldServer overworld = getWorld(0);
    if (overworld == null)
    {
        throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
    }
    try
    {
        // Cauldron start - Fixes MultiVerse issue when mods such as Twilight Forest try to hotload their dimension when using its WorldProvider
        if(net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading)
        {
            return;
        }
        // Cauldron end
        DimensionManager.getProviderType(dim);
    }
    catch (Exception e)
    {
        System.err.println("Cannot Hotload Dim: " + e.getMessage());
        return; // If a provider hasn't been registered then we can't hotload the dim
    }
    MinecraftServer mcServer = overworld.func_73046_m();
    ISaveHandler savehandler = overworld.getSaveHandler();
    WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());

    // Cauldron start - handles hotloading dimensions
    String worldType;
    String name;
    String oldName = "";
    Environment env = Environment.getEnvironment(getProviderType(dim));
    if (dim >= -1 && dim <= 1)
    {
        if ((dim == -1 && !mcServer.getAllowNether()) || (dim == 1 && !mcServer.server.getAllowEnd()))
            return;
        worldType = env.toString().toLowerCase();
        name = "DIM" + dim;
    }
    else
    {
        WorldProvider provider = WorldProvider.getProviderForDimension(dim);
        worldType = provider.getClass().getSimpleName().toLowerCase();
        worldType = worldType.replace("worldprovider", "");
        oldName = "world_" + worldType;
        worldType = worldType.replace("provider", "");

        if (Environment.getEnvironment(DimensionManager.getProviderType(dim)) == null)
                env = DimensionManager.registerBukkitEnvironment(DimensionManager.getProviderType(provider.getClass()), worldType);

        name = provider.getSaveFolder();
        if (name == null) name = "DIM0";
    }
    // add ability to disable dimensions
    if (!MinecraftServer.getServer().cauldronConfig.getBoolean("world-environment-settings." + worldType + ".enabled", true))
        return;

    CauldronUtils.migrateWorlds(worldType, oldName, overworld.getWorldInfo().getWorldName(), name); // Cauldron
    ChunkGenerator gen = mcServer.server.getGenerator(name);
    if (mcServer instanceof DedicatedServer) {
        worldSettings.func_82750_a(((DedicatedServer) mcServer).getStringProperty("generator-settings", ""));
    }
    WorldServer world = new WorldServerMulti(mcServer, new AnvilSaveHandler(mcServer.server.getWorldContainer(), name, true), name, dim, worldSettings, overworld, mcServer.theProfiler, env, gen);

    if (gen != null)
    {
        world.getWorld().getPopulators().addAll(gen.getDefaultPopulators(world.getWorld()));
    }
    mcServer.getConfigurationManager().setPlayerManager(mcServer.worlds.toArray(new WorldServer[mcServer.worlds.size()]));
    world.addWorldAccess(new WorldManager(mcServer, world));
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
    mcServer.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
    // Cauldron end
    if (!mcServer.isSinglePlayer())
    {
        world.getWorldInfo().setGameType(mcServer.getGameType());
    }

    mcServer.func_147139_a(mcServer.func_147135_j());
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:80,代码来源:DimensionManager.java


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