當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldServer.getWorldInfo方法代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:22,代碼來源:WorldServerProxy.java

示例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);
    }
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:22,代碼來源:EnvironmentHelper.java

示例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));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:41,代碼來源:MinecraftServer.java

示例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));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:42,代碼來源:MinecraftServer.java


注:本文中的net.minecraft.world.WorldServer.getWorldInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。