Java Code Examples for net.minecraft.entity.player.EntityPlayer.isPlayerFullyAsleep()

The following are Jave code examples for showing how to use isPlayerFullyAsleep() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: WorldServer.java   View Source Code Vote up 6 votes
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: WorldServer.java   View Source Code Vote up 6 votes
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 3
Project: BaseClient   File: WorldServer.java   View Source Code Vote up 6 votes
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 4
Project: BaseClient   File: WorldServer.java   View Source Code Vote up 6 votes
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 5
Project: FirstAid   File: MorpheusHelper.java   View Source Code Vote up 6 votes
@Override
public void startNewDay() {
    if (oldHandler != null) oldHandler.startNewDay(); //Start the new day

    if (FirstAidConfig.externalHealing.sleepHealing == 0F) return;

    WorldSleepState sleepState = Morpheus.playerSleepStatus.get(0);
    if (sleepState == null) return;

    if (areEnoughPlayersAsleep(sleepState)) {
        World world = DimensionManager.getWorld(0);
        for (EntityPlayer player : world.playerEntities) {
            if (player.isPlayerFullyAsleep()) {
                HealthDistribution.distributeHealth(FirstAid.activeHealingConfig.sleepHealing, player, true); //heal the player who did sleep
            }
        }
    }
}
 
Example 6
Project: Backmemed   File: WorldServer.java   View Source Code Vote up 6 votes
/**
 * Checks if all players in this world are sleeping.
 */
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (!entityplayer.isSpectator() && !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 7
Project: CustomWorldGen   File: WorldServer.java   View Source Code Vote up 6 votes
/**
 * Checks if all players in this world are sleeping.
 */
public boolean areAllPlayersAsleep()
{
    if (this.allPlayersSleeping && !this.isRemote)
    {
        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (!entityplayer.isSpectator() && !entityplayer.isPlayerFullyAsleep())
            {
                return false;
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}