RenderEntityItem.java 文件源码

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

项目:CustomWorldGen 作者:
private int transformModelCount(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_)
{
    ItemStack itemstack = itemIn.getEntityItem();
    Item item = itemstack.getItem();

    if (item == null)
    {
        return 0;
    }
    else
    {
        boolean flag = p_177077_9_.isGui3d();
        int i = this.getModelCount(itemstack);
        float f = 0.25F;
        float f1 = shouldBob() ? MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F : 0;
        float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
        GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);

        if (flag || this.renderManager.options != null)
        {
            float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
            GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        return i;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号