org.bukkit.Bukkit.createWorld()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.bukkit.Bukkit.createWorld()方法的一些代码示例,展示了Bukkit.createWorld()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bukkit.createWorld()方法的具体详情如下:
包路径:org.bukkit.Bukkit
类名称:Bukkit
方法名:createWorld

Bukkit.createWorld介绍

暂无

代码示例

代码示例来源:origin: Bukkit/Bukkit

/**
 * Creates a world with the specified options.
 * <p>
 * If the world already exists, it will be loaded from disk and some
 * options may be ignored.
 *
 * @return Newly created or loaded world
 */
public World createWorld() {
  return Bukkit.createWorld(this);
}

代码示例来源:origin: SpigotMC/Spigot-API

/**
 * Creates a world with the specified options.
 * <p>
 * If the world already exists, it will be loaded from disk and some
 * options may be ignored.
 *
 * @return Newly created or loaded world
 */
public World createWorld() {
  return Bukkit.createWorld(this);
}

代码示例来源:origin: elBukkit/MagicPlugin

@Nullable
protected World getWorld(String worldName, boolean loadWorld) {
  World world = Bukkit.getWorld(worldName);
  if (world == null) {
    if (loadWorld) {
      Bukkit.getLogger().info("Loading world: " + worldName);
      world = Bukkit.createWorld(new WorldCreator(worldName));
      if (world == null) {
        Bukkit.getLogger().warning("Failed to load world: " + worldName);
        return null;
      }
    }
  }
  if (world == null) {
    Bukkit.getLogger().warning("Could not load world: " + worldName);
  }
  return world;
}

代码示例来源:origin: elBukkit/MagicPlugin

if (canCreateWorlds && world != null) {
  Bukkit.getLogger().info("Creating/Loading world: " + worldName);
  worldOverride = Bukkit.createWorld(new WorldCreator(worldName).copy(world));
  if (worldOverride == null) {
    Bukkit.getLogger().warning("Failed to load world: " + worldName);

代码示例来源:origin: elBukkit/MagicPlugin

protected World getWorld(CastContext context, String worldName, boolean loadWorld, World copyFrom) {
  World world = Bukkit.getWorld(worldName);
  if (world == null) {
    if (loadWorld) {
      if (copyFrom != null) {
        context.getLogger().info("Creating world: " + worldName + " as copy of " + copyFrom.getName());
        world = Bukkit.createWorld(new WorldCreator(worldName).copy(copyFrom));
      } else {
        context.getLogger().info("Loading world: " + worldName);
        world = Bukkit.createWorld(new WorldCreator(worldName));
      }
    }
  }
  if (world == null) {
    Bukkit.getLogger().warning("Could not load world: " + worldName);
  }
  return world;
}

代码示例来源:origin: DRE2N/DungeonsXL

instance.world = Bukkit.createWorld(WorldCreator.name(name).environment(getWorldEnvironment()));
if (Bukkit.getPluginManager().getPlugin("dynmap") != null) {
  Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dynmap pause all");

相关文章