本文整理汇总了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;
}
示例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;
}