CompressedRenderHandler.java 文件源码

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

项目:JAM 作者:
private void renderEquipped(ItemStack stack) {
    GL11.glPushMatrix();
    Tessellator tessellator = Tessellator.instance;

    int meta = stack.getItemDamage();
    for (int pass = 0; pass < stack.getItem().getRenderPasses(meta); ++pass) {
        IIcon icon = stack.getItem().getIconFromDamageForRenderPass(meta, pass);
        if (icon == null) {
            continue;
        }

        if (renderItem.renderWithColor) {
            int color = stack.getItem().getColorFromItemStack(stack, pass);
            float c1 = (float) (color >> 16 & 255) / 255.0F;
            float c2 = (float) (color >> 8 & 255) / 255.0F;
            float c3 = (float) (color & 255) / 255.0F;

            GL11.glColor4f(c1, c2, c3, 1.0F);
        }

        float uv1 = icon.getMinU();
        float uv2 = icon.getMaxU();
        float uv3 = icon.getMinV();
        float uv4 = icon.getMaxV();

        ItemRenderer.renderItemIn2D(tessellator, uv2, uv3, uv1, uv4, icon.getIconWidth(), icon.getIconHeight(), PIXEL);
    }

    GL11.glPopMatrix();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号