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


Java WorldProvider.canRespawnHere方法代碼示例

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


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

示例1: updatePlayerInstances

import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
/**
 * updates all the player instances that need to be updated
 */
public void updatePlayerInstances()
{
    long i = this.theWorldServer.getTotalWorldTime();

    if (i - this.previousTotalWorldTime > 8000L)
    {
        this.previousTotalWorldTime = i;

        for (int j = 0; j < this.playerInstanceList.size(); ++j)
        {
            PlayerManager.PlayerInstance playermanager$playerinstance = (PlayerManager.PlayerInstance)this.playerInstanceList.get(j);
            playermanager$playerinstance.onUpdate();
            playermanager$playerinstance.processChunk();
        }
    }
    else
    {
        for (int k = 0; k < this.playerInstancesToUpdate.size(); ++k)
        {
            PlayerManager.PlayerInstance playermanager$playerinstance1 = (PlayerManager.PlayerInstance)this.playerInstancesToUpdate.get(k);
            playermanager$playerinstance1.onUpdate();
        }
    }

    this.playerInstancesToUpdate.clear();

    if (this.players.isEmpty())
    {
        WorldProvider worldprovider = this.theWorldServer.provider;

        if (!worldprovider.canRespawnHere())
        {
            this.theWorldServer.theChunkProviderServer.unloadAllChunks();
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:40,代碼來源:PlayerManager.java

示例2: updatePlayerInstances

import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public void updatePlayerInstances()
{
    long i = this.theWorldServer.getTotalWorldTime();
    int j;
    PlayerManager.PlayerInstance playerinstance;

    if (i - this.previousTotalWorldTime > 8000L)
    {
        this.previousTotalWorldTime = i;

        for (j = 0; j < this.playerInstanceList.size(); ++j)
        {
            playerinstance = (PlayerManager.PlayerInstance)this.playerInstanceList.get(j);
            playerinstance.sendChunkUpdate();
            playerinstance.processChunk();
        }
    }
    else
    {
        for (j = 0; j < this.chunkWatcherWithPlayers.size(); ++j)
        {
            playerinstance = (PlayerManager.PlayerInstance)this.chunkWatcherWithPlayers.get(j);
            playerinstance.sendChunkUpdate();
        }
    }

    this.chunkWatcherWithPlayers.clear();

    if (this.players.isEmpty())
    {
        WorldProvider worldprovider = this.theWorldServer.provider;

        if (!worldprovider.canRespawnHere())
        {
            this.theWorldServer.theChunkProviderServer.unloadAllChunks();
        }
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:39,代碼來源:PlayerManager.java

示例3: updatePlayerInstances

import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
/**
 * updates all the player instances that need to be updated
 */
public void updatePlayerInstances()
{
    long i = this.theWorldServer.getTotalWorldTime();
    int j;
    PlayerInstance playerinstance;

    if (i - this.previousTotalWorldTime > 8000L)
    {
        this.previousTotalWorldTime = i;

        for (j = 0; j < this.playerInstanceList.size(); ++j)
        {
            playerinstance = (PlayerInstance)this.playerInstanceList.get(j);
            playerinstance.sendChunkUpdate();
            playerinstance.processChunk();
        }
    }
    else
    {
        for (j = 0; j < this.chunkWatcherWithPlayers.size(); ++j)
        {
            playerinstance = (PlayerInstance)this.chunkWatcherWithPlayers.get(j);
            playerinstance.sendChunkUpdate();
        }
    }

    this.chunkWatcherWithPlayers.clear();

    if (this.players.isEmpty())
    {
        WorldProvider worldprovider = this.theWorldServer.provider;

        if (!worldprovider.canRespawnHere())
        {
            this.theWorldServer.theChunkProviderServer.unloadAllChunks();
        }
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:42,代碼來源:PlayerManager.java


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