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


Java NetHandlerPlayClient.cleanup方法代碼示例

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


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

示例1: loadWorld

import net.minecraft.client.network.NetHandlerPlayClient; //導入方法依賴的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.network.NetHandlerPlayClient; //導入方法依賴的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

示例3: loadWorld

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

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

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

        this.theIntegratedServer = null;
        this.guiAchievement.func_146257_b();
        this.entityRenderer.getMapItemRenderer().func_148249_a();
    }

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

    if (this.loadingScreen != null)
    {
        this.loadingScreen.resetProgressAndMessage(par2Str);
        this.loadingScreen.resetProgresAndWorkingMessage("");
    }

    if (par1WorldClient == null && this.theWorld != null)
    {
        if (this.mcResourcePackRepository.func_148530_e() != null)
        {
            this.scheduleResourcesRefresh();
        }

        this.mcResourcePackRepository.func_148529_f();
        this.setServerData((ServerData)null);
        this.integratedServerIsRunning = false;
    }

    this.mcSoundHandler.func_147690_c();
    this.theWorld = par1WorldClient;

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

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

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

        this.thePlayer.preparePlayerToSpawn();
        par1WorldClient.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:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:82,代碼來源:Minecraft.java


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