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

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

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

Server.getPort介绍

[英]Get the game port that the server runs on.
[中]获取服务器运行的游戏端口。

代码示例

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

/**
 * @see Server#getPort()
 */
public static int getPort() {
  return server.getPort();
}

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

/**
 * @see Server#getPort()
 */
public static int getPort() {
  return server.getPort();
}

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

@Override
public int getPort() {
  return s.getPort();
}

代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics

public BukkitServerProperties(Server server) {
  super(
      server.getServerId(),
      server.getName(),
      server.getPort(),
      server.getVersion(),
      server.getBukkitVersion(),
      server::getIp,
      server.getMaxPlayers(),
      () -> server.getOnlinePlayers().size()
  );
}

代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics

public PlanBukkitMocker withServer() {
  Server serverMock = Mockito.mock(Server.class);
  doReturn("").when(serverMock).getIp();
  doReturn("Bukkit").when(serverMock).getName();
  doReturn("Bukkit").when(serverMock).getServerName();
  doReturn(25565).when(serverMock).getPort();
  doReturn("1.12.2").when(serverMock).getVersion();
  doReturn("32423").when(serverMock).getBukkitVersion();
  Mockito.doReturn(TestConstants.BUKKIT_MAX_PLAYERS).when(serverMock).getMaxPlayers();
  ConsoleCommandSender sender = Mockito.mock(ConsoleCommandSender.class);
  doReturn(sender).when(serverMock).getConsoleSender();
  BukkitScheduler bukkitScheduler = Mockito.mock(BukkitScheduler.class);
  doReturn(bukkitScheduler).when(serverMock).getScheduler();
  doReturn(serverMock).when(planMock).getServer();
  return this;
}

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

final int connectPort = server.getPort();

相关文章

Server类方法