本文整理匯總了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;
}