org.bukkit.Server.shutdown()方法的使用及代码示例

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

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

Server.shutdown介绍

[英]Shutdowns the server, stopping everything.
[中]关闭服务器,停止一切。

代码示例

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

/**
 * @see Server#shutdown()
 */
public static void shutdown() {
  server.shutdown();
}

代码示例来源:origin: GlowstoneMC/Glowstone

@Override
  public boolean execute(CommandSender sender, String label, String[] args,
      CommandMessages commandMessages) {
    if (!testPermission(sender, commandMessages.getPermissionMessage())) {
      return true;
    }
    Server server = ServerProvider.getServer();
    if (args.length > 0 && server instanceof GlowServer) {
      ((GlowServer) server).shutdown(String.join(" ", args));
    } else {
      server.shutdown();
    }
    return true;
  }
}

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

/**
 * @see Server#shutdown()
 */
public static void shutdown() {
  server.shutdown();
}

代码示例来源:origin: EngineHub/CommandHelper

@Override
public void shutdown() {
  s.shutdown();
}

代码示例来源:origin: TotalFreedom/TotalFreedomMod

@Override
  public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
  {
    FUtil.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE);

    for (Player player : server.getOnlinePlayers())
    {
      player.kickPlayer("Server is going offline, come back in about 20 seconds.");
    }

    server.shutdown();

    return true;
  }
}

代码示例来源:origin: TotalFreedom/TotalFreedomMod

@Override
  public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
  {
    plugin.sf.setSavedFlag("do_wipe_flatlands", true);

    FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);

    for (Player player : server.getOnlinePlayers())
    {
      player.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes.");
    }

    server.shutdown();

    return true;
  }
}

代码示例来源:origin: TotalFreedom/TotalFreedomMod

server.shutdown();

相关文章

Server类方法