本文整理汇总了Java中net.minecraft.world.WorldServer.getWorldInfo方法的典型用法代码示例。如果您正苦于以下问题:Java WorldServer.getWorldInfo方法的具体用法?Java WorldServer.getWorldInfo怎么用?Java WorldServer.getWorldInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.WorldServer
的用法示例。
在下文中一共展示了WorldServer.getWorldInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WorldServerProxy
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public WorldServerProxy(WorldServer realWorld, WorldServer proxyWorld, String modClass) {
super(proxyWorld.getMinecraftServer(), proxyWorld.getSaveHandler(), proxyWorld.getWorldInfo(), proxyWorld.provider.getDimension(), proxyWorld.profiler);
// fix the dimension manager!
net.minecraftforge.common.DimensionManager.setWorld(this.provider.getDimension(), proxyWorld, proxyWorld.getMinecraftServer());
m_realWorld = realWorld;
m_proxyWorld = proxyWorld;
m_modPrefix = Util.getClassDomainFromName(modClass);
InjectionHandler.copyAllFieldsFrom(this, m_realWorld, WorldServer.class);
try {
InjectionHandler.writeFieldOfType(
this,
new WorldProviderProxyServer(m_realWorld.provider, m_proxyWorld.provider, modClass),
WorldProvider.class);
} catch (IllegalAccessException e) {
Util.logger.logException("Unable to set WorldProviderProxyServer", e);
}
}
示例2: setMissionWeather
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public static void setMissionWeather(MissionInit minit)
{
ServerSection ss = minit.getMission().getServerSection();
ServerInitialConditions sic = (ss != null) ? ss.getServerInitialConditions() : null;
if (sic != null && sic.getWeather() != null && !sic.getWeather().equalsIgnoreCase("normal"))
{
int maxtime = 1000000 * 20; // Max allowed by Minecraft's own Weather Command.
int cleartime = (sic.getWeather().equalsIgnoreCase("clear")) ? maxtime : 0;
int raintime = (sic.getWeather().equalsIgnoreCase("rain")) ? maxtime : 0;
int thundertime = (sic.getWeather().equalsIgnoreCase("thunder")) ? maxtime : 0;
WorldServer worldserver = MinecraftServer.getServer().worldServers[0];
WorldInfo worldinfo = worldserver.getWorldInfo();
worldinfo.setCleanWeatherTime(cleartime);
worldinfo.setRainTime(raintime);
worldinfo.setThunderTime(thundertime);
worldinfo.setRaining(raintime + thundertime > 0);
worldinfo.setThundering(thundertime > 0);
}
}
示例3: addServerStatsToSnooper
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public void addServerStatsToSnooper(Snooper playerSnooper)
{
playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false));
playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0));
if (this.playerList != null)
{
playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount()));
playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers()));
playerSnooper.addClientStat("players_seen", Integer.valueOf(this.playerList.getAvailablePlayerDat().length));
}
playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode));
playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled");
playerSnooper.addClientStat("run_time", Long.valueOf((getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
playerSnooper.addClientStat("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D)));
int i = 0;
if (this.worldServers != null)
{
for (WorldServer worldserver : this.worldServers)
{
if (worldserver != null)
{
WorldInfo worldinfo = worldserver.getWorldInfo();
playerSnooper.addClientStat("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.getDimensionType().getId()));
playerSnooper.addClientStat("world[" + i + "][mode]", worldinfo.getGameType());
playerSnooper.addClientStat("world[" + i + "][difficulty]", worldserver.getDifficulty());
playerSnooper.addClientStat("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled()));
playerSnooper.addClientStat("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName());
playerSnooper.addClientStat("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion()));
playerSnooper.addClientStat("world[" + i + "][height]", Integer.valueOf(this.buildLimit));
playerSnooper.addClientStat("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount()));
++i;
}
}
}
playerSnooper.addClientStat("worlds", Integer.valueOf(i));
}
示例4: addServerStatsToSnooper
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper)
{
playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false));
playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0));
if (this.serverConfigManager != null)
{
playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount()));
playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers()));
playerSnooper.addClientStat("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length));
}
playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode));
playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled");
playerSnooper.addClientStat("run_time", Long.valueOf((getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
playerSnooper.addClientStat("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D)));
int i = 0;
if (this.worldServers != null)
{
for (int j = 0; j < this.worldServers.length; ++j)
{
if (this.worldServers[j] != null)
{
WorldServer worldserver = this.worldServers[j];
WorldInfo worldinfo = worldserver.getWorldInfo();
playerSnooper.addClientStat("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.getDimensionId()));
playerSnooper.addClientStat("world[" + i + "][mode]", worldinfo.getGameType());
playerSnooper.addClientStat("world[" + i + "][difficulty]", worldserver.getDifficulty());
playerSnooper.addClientStat("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled()));
playerSnooper.addClientStat("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName());
playerSnooper.addClientStat("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion()));
playerSnooper.addClientStat("world[" + i + "][height]", Integer.valueOf(this.buildLimit));
playerSnooper.addClientStat("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount()));
++i;
}
}
}
playerSnooper.addClientStat("worlds", Integer.valueOf(i));
}