当前位置: 首页>>代码示例>>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;未经允许,请勿转载。