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


Java WorldClient.spawnEntityInWorld方法代碼示例

本文整理匯總了Java中net.minecraft.client.multiplayer.WorldClient.spawnEntityInWorld方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldClient.spawnEntityInWorld方法的具體用法?Java WorldClient.spawnEntityInWorld怎麽用?Java WorldClient.spawnEntityInWorld使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.multiplayer.WorldClient的用法示例。


在下文中一共展示了WorldClient.spawnEntityInWorld方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadWorld

import net.minecraft.client.multiplayer.WorldClient; //導入方法依賴的package包/類
/**
 * par2Str is displayed on the loading screen to the user unloads the current world first
 */
public void loadWorld(WorldClient worldClientIn, String loadingMessage)
{
    if (worldClientIn == null)
    {
        NetHandlerPlayClient nethandlerplayclient = this.getNetHandler();

        if (nethandlerplayclient != null)
        {
            nethandlerplayclient.cleanup();
        }

        if (this.theIntegratedServer != null && this.theIntegratedServer.isAnvilFileSet())
        {
            this.theIntegratedServer.initiateShutdown();
            this.theIntegratedServer.setStaticInstance();
        }

        this.theIntegratedServer = null;
        this.guiAchievement.clearAchievements();
        this.entityRenderer.getMapItemRenderer().clearLoadedMaps();
    }

    this.renderViewEntity = null;
    this.myNetworkManager = null;

    if (this.loadingScreen != null)
    {
        this.loadingScreen.resetProgressAndMessage(loadingMessage);
        this.loadingScreen.displayLoadingString("");
    }

    if (worldClientIn == null && this.theWorld != null)
    {
        this.mcResourcePackRepository.func_148529_f();
        this.ingameGUI.func_181029_i();
        this.setServerData((ServerData)null);
        this.integratedServerIsRunning = false;
    }

    this.mcSoundHandler.stopSounds();
    this.theWorld = worldClientIn;

    if (worldClientIn != null)
    {
        if (this.renderGlobal != null)
        {
            this.renderGlobal.setWorldAndLoadRenderers(worldClientIn);
        }

        if (this.effectRenderer != null)
        {
            this.effectRenderer.clearEffects(worldClientIn);
        }

        if (this.thePlayer == null)
        {
            this.thePlayer = this.playerController.func_178892_a(worldClientIn, new StatFileWriter());
            this.playerController.flipPlayer(this.thePlayer);
        }

        this.thePlayer.preparePlayerToSpawn();
        worldClientIn.spawnEntityInWorld(this.thePlayer);
        this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
        this.playerController.setPlayerCapabilities(this.thePlayer);
        this.renderViewEntity = this.thePlayer;
    }
    else
    {
        this.saveLoader.flushCache();
        this.thePlayer = null;
    }

    System.gc();
    this.systemTime = 0L;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:79,代碼來源:Minecraft.java

示例2: loadWorld

import net.minecraft.client.multiplayer.WorldClient; //導入方法依賴的package包/類
/**
 * par2Str is displayed on the loading screen to the user unloads the current
 * world first
 */
public void loadWorld(WorldClient worldClientIn, String loadingMessage) {
	if (worldClientIn == null) {
		NetHandlerPlayClient nethandlerplayclient = this.getNetHandler();

		if (nethandlerplayclient != null) {
			nethandlerplayclient.cleanup();
		}

		if (this.theIntegratedServer != null && this.theIntegratedServer.isAnvilFileSet()) {
			this.theIntegratedServer.initiateShutdown();
			this.theIntegratedServer.setStaticInstance();
		}

		this.theIntegratedServer = null;
		this.guiAchievement.clearAchievements();
		this.entityRenderer.getMapItemRenderer().clearLoadedMaps();
	}

	this.renderViewEntity = null;
	this.myNetworkManager = null;

	if (this.loadingScreen != null) {
		this.loadingScreen.resetProgressAndMessage(loadingMessage);
		this.loadingScreen.displayLoadingString("");
	}

	if (worldClientIn == null && this.theWorld != null) {
		this.mcResourcePackRepository.func_148529_f();
		this.ingameGUI.func_181029_i();
		this.setServerData((ServerData) null);
		this.integratedServerIsRunning = false;
	}

	this.mcSoundHandler.stopSounds();
	this.theWorld = worldClientIn;

	if (worldClientIn != null) {
		if (this.renderGlobal != null) {
			this.renderGlobal.setWorldAndLoadRenderers(worldClientIn);
		}

		if (this.effectRenderer != null) {
			this.effectRenderer.clearEffects(worldClientIn);
		}

		if (this.thePlayer == null) {
			this.thePlayer = this.playerController.func_178892_a(worldClientIn, new StatFileWriter());
			this.playerController.flipPlayer(this.thePlayer);
		}

		this.thePlayer.preparePlayerToSpawn();
		worldClientIn.spawnEntityInWorld(this.thePlayer);
		this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
		this.playerController.setPlayerCapabilities(this.thePlayer);
		this.renderViewEntity = this.thePlayer;
	} else {
		this.saveLoader.flushCache();
		this.thePlayer = null;
	}

	System.gc();
	this.systemTime = 0L;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:68,代碼來源:Minecraft.java


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