EntityMob.java 文件源码

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

项目:Backmemed 作者:
/**
 * Checks to make sure the light is not too bright where the mob is spawning
 */
protected boolean isValidLightLevel()
{
    BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);

    if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
    {
        return false;
    }
    else
    {
        int i = this.world.getLightFromNeighbors(blockpos);

        if (this.world.isThundering())
        {
            int j = this.world.getSkylightSubtracted();
            this.world.setSkylightSubtracted(10);
            i = this.world.getLightFromNeighbors(blockpos);
            this.world.setSkylightSubtracted(j);
        }

        return i <= this.rand.nextInt(8);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号