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

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

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

Bukkit.getOnlineMode介绍

暂无

代码示例

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

public PlayerLoginStartEvent(Connection connection, String hostname) {
  super(connection);
  this.onlinemode = Bukkit.getOnlineMode();
  this.hostname = hostname;
}

代码示例来源:origin: DevLeoko/AdvancedBan

@Override
public boolean isOnlineMode() {
  return Bukkit.getOnlineMode();
}

代码示例来源:origin: dzikoysk/WildSkript

protected Boolean[] get(Event event) {
  return new Boolean[]{ Bukkit.getOnlineMode() };
}

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

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
  // Minecraft specific data
  int playerAmount = Bukkit.getOnlinePlayers().size();
  int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
  String bukkitVersion = org.bukkit.Bukkit.getVersion();
  bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
  // OS/Java specific data
  String javaVersion = System.getProperty("java.version");
  String osName = System.getProperty("os.name");
  String osArch = System.getProperty("os.arch");
  String osVersion = System.getProperty("os.version");
  int coreCount = Runtime.getRuntime().availableProcessors();
  JSONObject data = new JSONObject();
  data.put("serverUUID", serverUUID);
  data.put("playerAmount", playerAmount);
  data.put("onlineMode", onlineMode);
  data.put("bukkitVersion", bukkitVersion);
  data.put("javaVersion", javaVersion);
  data.put("osName", osName);
  data.put("osArch", osArch);
  data.put("osVersion", osVersion);
  data.put("coreCount", coreCount);
  return data;
}

代码示例来源:origin: io.github.bedwarsrel/BedwarsRel-Common

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
 // Minecraft specific data
 int playerAmount = Bukkit.getOnlinePlayers().size();
 int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
 String bukkitVersion = org.bukkit.Bukkit.getVersion();
 bukkitVersion =
   bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
 // OS/Java specific data
 String javaVersion = System.getProperty("java.version");
 String osName = System.getProperty("os.name");
 String osArch = System.getProperty("os.arch");
 String osVersion = System.getProperty("os.version");
 int coreCount = Runtime.getRuntime().availableProcessors();
 JSONObject data = new JSONObject();
 data.put("serverUUID", serverUUID);
 data.put("playerAmount", playerAmount);
 data.put("onlineMode", onlineMode);
 data.put("bukkitVersion", bukkitVersion);
 data.put("javaVersion", javaVersion);
 data.put("osName", osName);
 data.put("osArch", osArch);
 data.put("osVersion", osVersion);
 data.put("coreCount", coreCount);
 return data;
}

代码示例来源:origin: libraryaddict/LibsDisguises

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
  // Minecraft specific data
  int playerAmount = Bukkit.getOnlinePlayers().size();
  int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
  String bukkitVersion = org.bukkit.Bukkit.getVersion();
  bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
  // OS/Java specific data
  String javaVersion = System.getProperty("java.version");
  String osName = System.getProperty("os.name");
  String osArch = System.getProperty("os.arch");
  String osVersion = System.getProperty("os.version");
  int coreCount = Runtime.getRuntime().availableProcessors();
  JSONObject data = new JSONObject();
  data.put("serverUUID", serverUUID);
  data.put("playerAmount", playerAmount);
  data.put("onlineMode", onlineMode);
  data.put("bukkitVersion", bukkitVersion);
  data.put("javaVersion", javaVersion);
  data.put("osName", osName);
  data.put("osArch", osArch);
  data.put("osVersion", osVersion);
  data.put("coreCount", coreCount);
  return data;
}

代码示例来源:origin: InventivetalentDev/AnimatedFrames

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
  // Minecraft specific data
  int playerAmount = Bukkit.getOnlinePlayers().size();
  int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
  String bukkitVersion = org.bukkit.Bukkit.getVersion();
  bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
  // OS/Java specific data
  String javaVersion = System.getProperty("java.version");
  String osName = System.getProperty("os.name");
  String osArch = System.getProperty("os.arch");
  String osVersion = System.getProperty("os.version");
  int coreCount = Runtime.getRuntime().availableProcessors();
  JSONObject data = new JSONObject();
  data.put("serverUUID", serverUUID);
  data.put("playerAmount", playerAmount);
  data.put("onlineMode", onlineMode);
  data.put("bukkitVersion", bukkitVersion);
  data.put("javaVersion", javaVersion);
  data.put("osName", osName);
  data.put("osArch", osArch);
  data.put("osVersion", osVersion);
  data.put("coreCount", coreCount);
  return data;
}

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

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
  // Minecraft specific data.
  final int playerAmount = Bukkit.getOnlinePlayers().size();
  final int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
  String bukkitVersion = org.bukkit.Bukkit.getVersion();
  bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
  // OS/Java specific data.
  final String javaVersion = System.getProperty("java.version");
  final String osName = System.getProperty("os.name");
  final String osArch = System.getProperty("os.arch");
  final String osVersion = System.getProperty("os.version");
  final int coreCount = Runtime.getRuntime().availableProcessors();
  final JSONObject data = new JSONObject();
  data.put("serverUUID", serverUUID);
  data.put("playerAmount", playerAmount);
  data.put("onlineMode", onlineMode);
  data.put("bukkitVersion", bukkitVersion);
  data.put("javaVersion", javaVersion);
  data.put("osName", osName);
  data.put("osArch", osArch);
  data.put("osVersion", osVersion);
  data.put("coreCount", coreCount);
  return data;
}

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

/**
 * Gets the server specific data.
 *
 * @return The server specific data.
 */
private JSONObject getServerData() {
 // Minecraft specific data
 int playerAmount = Bukkit.getOnlinePlayers().size();
 int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
 String bukkitVersion = org.bukkit.Bukkit.getVersion();
 bukkitVersion =
   bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);
 // OS/Java specific data
 String javaVersion = System.getProperty("java.version");
 String osName = System.getProperty("os.name");
 String osArch = System.getProperty("os.arch");
 String osVersion = System.getProperty("os.version");
 int coreCount = Runtime.getRuntime().availableProcessors();
 JSONObject data = new JSONObject();
 data.put("serverUUID", serverUUID);
 data.put("playerAmount", playerAmount);
 data.put("onlineMode", onlineMode);
 data.put("bukkitVersion", bukkitVersion);
 data.put("javaVersion", javaVersion);
 data.put("osName", osName);
 data.put("osArch", osArch);
 data.put("osVersion", osVersion);
 data.put("coreCount", coreCount);
 return data;
}

代码示例来源:origin: aadnk/ProtocolLib

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = org.bukkit.Bukkit.getVersion();
bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);

代码示例来源:origin: Bkm016/TabooLib

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = org.bukkit.Bukkit.getVersion();
bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);

代码示例来源:origin: sgtcaze/NametagEdit

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = Bukkit.getVersion();

代码示例来源:origin: mcmonkeyprojects/Sentinel

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = Bukkit.getVersion();

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

public boolean isIdentityMatched(Player player)
{
  if (Bukkit.getOnlineMode())
  {
    return true;
  }
  Admin admin = getAdmin(player);
  return admin == null ? false : admin.getName().equalsIgnoreCase(player.getName());
}

代码示例来源:origin: Bastian/bStats-Metrics

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = Bukkit.getVersion();

代码示例来源:origin: Bastian/bStats-Metrics

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = Bukkit.getVersion();

代码示例来源:origin: dzikoysk/WildSkript

private void postPlugin(boolean isPing) throws IOException {
  String pluginName = "WS " + name;
  boolean onlineMode = Bukkit.getOnlineMode();
  String pluginVersion = version;
  String serverVersion = Bukkit.getVersion();

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

int onlineMode = Bukkit.getOnlineMode() ? 1 : 0;
String bukkitVersion = org.bukkit.Bukkit.getVersion();
bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1);

代码示例来源:origin: BuycraftPlugin/BuycraftX

@Override
  public void run() {
    ReportBuilder builder = ReportBuilder.builder()
        .client(plugin.getHttpClient())
        .configuration(plugin.getConfiguration())
        .platform(plugin.getPlatform())
        .duePlayerFetcher(plugin.getDuePlayerFetcher())
        .ip(Bukkit.getIp())
        .port(Bukkit.getPort())
        .listingUpdateTask(plugin.getListingUpdateTask())
        .serverOnlineMode(Bukkit.getOnlineMode())
        .build();
    SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss");
    String filename = "report-" + f.format(new Date()) + ".txt";
    Path p = plugin.getDataFolder().toPath().resolve(filename);
    String generated = builder.generate();
    try (BufferedWriter w = Files.newBufferedWriter(p, StandardCharsets.UTF_8, StandardOpenOption.CREATE_NEW)) {
      w.write(generated);
      sender.sendMessage(ChatColor.YELLOW + plugin.getI18n().get("report_saved", p.toAbsolutePath().toString()));
    } catch (IOException e) {
      sender.sendMessage(ChatColor.RED + plugin.getI18n().get("report_cant_save"));
      plugin.getLogger().info(generated);
    }
  }
});

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

if (Bukkit.getOnlineMode() || admin.getIps().contains(ip))

相关文章