当前位置: 首页>>代码示例>>Java>>正文


Java EntityPlayer.isPlayerSleeping方法代码示例

本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.isPlayerSleeping方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.isPlayerSleeping方法的具体用法?Java EntityPlayer.isPlayerSleeping怎么用?Java EntityPlayer.isPlayerSleeping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.player.EntityPlayer的用法示例。


在下文中一共展示了EntityPlayer.isPlayerSleeping方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateAllPlayersSleepingFlag

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
 * Updates the flag that indicates whether or not all players in the world are sleeping.
 */
public void updateAllPlayersSleepingFlag()
{
    this.allPlayersSleeping = false;

    if (!this.playerEntities.isEmpty())
    {
        int i = 0;
        int j = 0;

        for (EntityPlayer entityplayer : this.playerEntities)
        {
            if (entityplayer.isSpectator())
            {
                ++i;
            }
            else if (entityplayer.isPlayerSleeping())
            {
                ++j;
            }
        }

        this.allPlayersSleeping = j > 0 && j >= this.playerEntities.size() - i;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:WorldServer.java

示例2: wakeAllPlayers

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    if (this.getGameRules().getBoolean("doWeatherCycle"))
    {
        this.resetRainAndThunder();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:WorldServer.java

示例3: wakeAllPlayers

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:WorldServer.java

示例4: getPlayerInBed

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos)
{
    for (EntityPlayer entityplayer : worldIn.playerEntities)
    {
        if (entityplayer.isPlayerSleeping() && entityplayer.playerLocation.equals(pos))
        {
            return entityplayer;
        }
    }

    return null;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:BlockBed.java

示例5: getPlayerInBed

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Nullable
private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos)
{
    for (EntityPlayer entityplayer : worldIn.playerEntities)
    {
        if (entityplayer.isPlayerSleeping() && entityplayer.bedLocation.equals(pos))
        {
            return entityplayer;
        }
    }

    return null;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:BlockBed.java

示例6: onRender

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// set start position
	Vec3d start = RotationUtils.getClientLookVec()
		.addVector(0, WMinecraft.getPlayer().getEyeHeight(), 0)
		.addVector(mc.getRenderManager().renderPosX,
			mc.getRenderManager().renderPosY,
			mc.getRenderManager().renderPosZ);
	
	GL11.glBegin(GL11.GL_LINES);
	for(EntityPlayer entity : WMinecraft.getWorld().playerEntities)
	{
		if(entity == WMinecraft.getPlayer()
			|| entity instanceof EntityFakePlayer)
			continue;
		
		// fake entities with crazy vertical position
		if(Math.abs(entity.posY - WMinecraft.getPlayer().posY) > 1e6)
			continue;
		
		if(!wurst.special.targetSpf.sleepingPlayers.isChecked()
			&& entity.isPlayerSleeping())
			continue;
		
		if(!wurst.special.targetSpf.invisiblePlayers.isChecked()
			&& entity.isInvisible())
			continue;
		
		// set end position
		Vec3d end = entity.boundingBox.getCenter()
			.subtract(new Vec3d(entity.posX, entity.posY, entity.posZ)
				.subtract(entity.prevPosX, entity.prevPosY, entity.prevPosZ)
				.scale(1 - partialTicks));
		
		// set color
		if(wurst.friends.contains(entity.getName()))
			GL11.glColor4f(0, 0, 1, 0.5F);
		else
		{
			float factor =
				WMinecraft.getPlayer().getDistanceToEntity(entity) / 40F;
			if(factor > 1)
				factor = 1;
			
			GL11.glColor4f(2 - factor * 2F, factor * 2F, 0, 0.5F);
		}
		
		// draw line
		GL11.glVertex3d(start.xCoord, start.yCoord, start.zCoord);
		GL11.glVertex3d(end.xCoord, end.yCoord, end.zCoord);
	}
	GL11.glEnd();
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:77,代码来源:TracersMod.java

示例7: onRender

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-mc.getRenderManager().renderPosX,
		-mc.getRenderManager().renderPosY,
		-mc.getRenderManager().renderPosZ);
	
	// draw boxes
	for(EntityPlayer entity : WMinecraft.getWorld().playerEntities)
	{
		if(entity == WMinecraft.getPlayer()
			|| entity instanceof EntityFakePlayer)
			continue;
		
		if(!wurst.special.targetSpf.sleepingPlayers.isChecked()
			&& entity.isPlayerSleeping())
			continue;
		
		if(!wurst.special.targetSpf.invisiblePlayers.isChecked()
			&& entity.isInvisible())
			continue;
		
		// set color
		if(wurst.friends.contains(entity.getName()))
			GL11.glColor4f(0, 0, 1, 0.5F);
		else
		{
			float factor =
				WMinecraft.getPlayer().getDistanceToEntity(entity) / 20F;
			if(factor > 2)
				factor = 2;
			GL11.glColor4f(2 - factor, factor, 0, 0.5F);
		}
		
		// set position
		GL11.glPushMatrix();
		GL11.glTranslated(
			entity.prevPosX
				+ (entity.posX - entity.prevPosX) * partialTicks,
			entity.prevPosY
				+ (entity.posY - entity.prevPosY) * partialTicks,
			entity.prevPosZ
				+ (entity.posZ - entity.prevPosZ) * partialTicks);
		
		// draw box
		RenderUtils.drawOutlinedBox(PLAYER_BOX);
		
		GL11.glPopMatrix();
	}
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:68,代码来源:PlayerEspMod.java

示例8: isSleeping

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public static boolean isSleeping(EntityPlayer ent) {
    return ent.isPlayerSleeping();
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:ZWrapper.java

示例9: getSleeping

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Deprecated
public static boolean getSleeping(EntityPlayer ent) {
    return ent.isPlayerSleeping();
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:ZWrapper.java


注:本文中的net.minecraft.entity.player.EntityPlayer.isPlayerSleeping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。