本文整理了Java中org.bukkit.Server.getPort()
方法的一些代码示例,展示了Server.getPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getPort()
方法的具体详情如下:
包路径:org.bukkit.Server
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!