TileEntityCryogenicChamber.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:4Space-5 作者:
public EnumStatus sleepInBedAt(EntityPlayer entityPlayer, int par1, int par2, int par3)
{
    if (!this.worldObj.isRemote)
    {
        if (entityPlayer.isPlayerSleeping() || !entityPlayer.isEntityAlive())
        {
            return EnumStatus.OTHER_PROBLEM;
        }

        if (this.worldObj.getBiomeGenForCoords(par1, par3) == BiomeGenBase.hell)
        {
            return EnumStatus.NOT_POSSIBLE_HERE;
        }

        if (GCPlayerStats.get((EntityPlayerMP) entityPlayer).cryogenicChamberCooldown > 0)
        {
            return EnumStatus.NOT_POSSIBLE_NOW;
        }
    }

    if (entityPlayer.isRiding())
    {
        entityPlayer.mountEntity((Entity) null);
    }

    entityPlayer.setPosition(this.xCoord + 0.5F, this.yCoord + 1.9F, this.zCoord + 0.5F);

    entityPlayer.sleeping = true;
    entityPlayer.sleepTimer = 0;
    entityPlayer.playerLocation = new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
    entityPlayer.motionX = entityPlayer.motionZ = entityPlayer.motionY = 0.0D;

    if (!this.worldObj.isRemote)
    {
        this.worldObj.updateAllPlayersSleepingFlag();
    }

    return EnumStatus.OK;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号