本文整理了Java中org.bukkit.Server.getIp()
方法的一些代码示例,展示了Server.getIp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getIp()
方法的具体详情如下:
包路径:org.bukkit.Server
类名称:Server
方法名:getIp
[英]Get the IP that this server is bound to, or empty string if not specified.
[中]获取此服务器绑定到的IP,如果未指定,则获取空字符串。
代码示例来源:origin: Bukkit/Bukkit
/**
* @see Server#getIp()
*/
public static String getIp() {
return server.getIp();
}
代码示例来源:origin: webbukkit/dynmap
@Override
public String getServerIP() {
return Bukkit.getServer().getIp();
}
代码示例来源:origin: SpigotMC/Spigot-API
/**
* @see Server#getIp()
*/
public static String getIp() {
return server.getIp();
}
代码示例来源:origin: EngineHub/CommandHelper
@Override
public String getIp() {
return s.getIp();
}
代码示例来源: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: NuVotifier/NuVotifier
String hostAddr = Bukkit.getServer().getIp();
if (hostAddr == null || hostAddr.length() == 0)
hostAddr = "0.0.0.0";
内容来源于网络,如有侵权,请联系作者删除!