ActiveRenderInfo.java 文件源码

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

项目:RuneCraftery 作者:
/**
 * Returns the block ID at the current camera location (either air or fluid), taking into account the height of
 * fluid blocks
 */
public static int getBlockIdAtEntityViewpoint(World par0World, EntityLivingBase par1EntityLivingBase, float par2)
{
    Vec3 vec3 = projectViewFromEntity(par1EntityLivingBase, (double)par2);
    ChunkPosition chunkposition = new ChunkPosition(vec3);
    int i = par0World.getBlockId(chunkposition.x, chunkposition.y, chunkposition.z);

    if (i != 0 && Block.blocksList[i].blockMaterial.isLiquid())
    {
        float f1 = BlockFluid.getFluidHeightPercent(par0World.getBlockMetadata(chunkposition.x, chunkposition.y, chunkposition.z)) - 0.11111111F;
        float f2 = (float)(chunkposition.y + 1) - f1;

        if (vec3.yCoord >= (double)f2)
        {
            i = par0World.getBlockId(chunkposition.x, chunkposition.y + 1, chunkposition.z);
        }
    }

    return i;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号