org.bukkit.WorldCreator#type ( )源码实例Demo

下面列出了org.bukkit.WorldCreator#type ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: civcraft   文件: ArenaManager.java
private static World createArenaWorld(ConfigArena arena, String name) {
	World world;
	world = Bukkit.getServer().getWorld(name);
	if (world == null) {
		WorldCreator wc = new WorldCreator(name);
		wc.environment(Environment.NORMAL);
		wc.type(WorldType.FLAT);
		wc.generateStructures(false);
		
		world = Bukkit.getServer().createWorld(wc);
		world.setAutoSave(false);
		world.setSpawnFlags(false, false);
		world.setKeepSpawnInMemory(false);
		ChunkCoord.addWorld(world);
	}
	
	return world;
}
 
源代码2 项目: DungeonsXL   文件: DResourceWorld.java
/**
 * Generate a new DResourceWorld.
 *
 * @return the automatically created DEditWorld instance
 */
public DEditWorld generate() {
    int id = DInstanceWorld.counter;
    String name = DInstanceWorld.generateName(false, id);
    File folder = new File(Bukkit.getWorldContainer(), name);
    WorldCreator creator = new WorldCreator(name);
    creator.type(WorldType.FLAT);
    creator.generateStructures(false);

    DEditWorld editWorld = new DEditWorld(plugin, this, folder);
    this.editWorld = editWorld;

    EditWorldGenerateEvent event = new EditWorldGenerateEvent(editWorld);
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return null;
    }

    if (!RAW.exists()) {
        createRaw();
    }
    FileUtil.copyDir(RAW, folder, DungeonsXL.EXCLUDED_FILES);
    editWorld.generateIdFile();
    editWorld.world = creator.createWorld().getName();
    editWorld.generateIdFile();

    return editWorld;
}
 
源代码3 项目: DungeonsXL   文件: DResourceWorld.java
/**
 * Creates the "raw" world that is copied for new instances.
 */
public static void createRaw() {
    WorldCreator rawCreator = WorldCreator.name(".raw");
    rawCreator.type(WorldType.FLAT);
    rawCreator.generateStructures(false);
    World world = rawCreator.createWorld();
    File worldFolder = new File(Bukkit.getWorldContainer(), ".raw");
    FileUtil.copyDir(worldFolder, RAW, DungeonsXL.EXCLUDED_FILES);
    Bukkit.unloadWorld(world, /* SPIGOT-5225 */ !Version.isAtLeast(Version.MC1_14_4));
    FileUtil.removeDir(worldFolder);
}
 
源代码4 项目: civcraft   文件: DebugWorldCommand.java
public void create_cmd() throws CivException {
	String name = getNamedString(1, "enter a world name");
	
	WorldCreator wc = new WorldCreator(name);
	wc.environment(Environment.NORMAL);
	wc.type(WorldType.FLAT);
	wc.generateStructures(false);
	
	World world = Bukkit.getServer().createWorld(wc);
	world.setSpawnFlags(false, false);
	ChunkCoord.addWorld(world);
	
	CivMessage.sendSuccess(sender, "World "+name+" created.");
	
}
 
 方法所在类
 同类方法