org.bukkit.plugin.Plugin.getDefaultWorldGenerator()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(156)

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

Plugin.getDefaultWorldGenerator介绍

[英]Gets a ChunkGenerator for use in a default world, as specified in the server configuration
[中]获取在默认世界中使用的ChunkGenerator,如服务器配置中指定的

代码示例

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

output.sendMessage("Could not set generator for world '" + world + "': Plugin '" + plugin.getDescription().getFullName() + "' is not enabled");
} else {
  result = plugin.getDefaultWorldGenerator(world, id);

代码示例来源:origin: Multiverse/Multiverse-Core

@Override
  public ChunkGenerator call() throws Exception {
    return myPlugin.getDefaultWorldGenerator(worldName, generatorID);
  }
}, myPlugin.getName(), "Failed to get the default chunk generator: %s");

代码示例来源:origin: Multiverse/Multiverse-Core

@Override
  public void runCommand(CommandSender sender, List<String> args) {
    Logging.info("PLEASE IGNORE the 'Plugin X does not contain any generators' message below!");
    Plugin[] plugins = this.plugin.getServer().getPluginManager().getPlugins();
    List<String> generators = new ArrayList<String>();
    for (Plugin p : plugins) {
      if (p.isEnabled() && p.getDefaultWorldGenerator("world", "") != null) {
        generators.add(p.getDescription().getName());
      }
    }
    sender.sendMessage(ChatColor.AQUA + "--- Loaded Generator Plugins ---");
    String loadedGens = "";
    boolean altColor = false;
    for (String s : generators) {
      loadedGens += (altColor ? ChatColor.YELLOW : ChatColor.WHITE) + s + " ";
      altColor = !altColor;
    }
    if (loadedGens.length() == 0) {
      loadedGens = ChatColor.RED + "No Generator Plugins found.";
    }
    sender.sendMessage(loadedGens);
  }
}

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

output.sendMessage("Could not set generator for world '" + world + "': Plugin '" + plugin.getDescription().getFullName() + "' is not enabled");
} else {
  result = plugin.getDefaultWorldGenerator(world, id);

相关文章