当前位置: 首页>>代码示例>>Java>>正文


Java IBakedModel.isBuiltInRenderer方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.block.model.IBakedModel.isBuiltInRenderer方法的典型用法代码示例。如果您正苦于以下问题:Java IBakedModel.isBuiltInRenderer方法的具体用法?Java IBakedModel.isBuiltInRenderer怎么用?Java IBakedModel.isBuiltInRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.block.model.IBakedModel的用法示例。


在下文中一共展示了IBakedModel.isBuiltInRenderer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderItem

import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model) {
	if (!stack.isEmpty()) {
		if (model.isBuiltInRenderer() && !(stack.getItem() instanceof ItemDankNullHolder)) {
			Minecraft.getMinecraft().getItemRenderer().renderItem(EasyMappings.player(), stack, ItemCameraTransforms.TransformType.NONE);
		}
		else {
			RenderModel.render(model, stack);
			if (stack.hasEffect()) {
				if ((stack.getItem() instanceof ItemDankNull)) {
					if (!Options.superShine) {
						GlintEffectRenderer.apply(model, stack.getItemDamage());
					}
					else {
						GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getItemDamage(), false));
					}
				}
				else {
					GlintEffectRenderer.apply(model, -1);
				}
			}
		}
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:24,代码来源:DankNullRenderer.java

示例2: renderItem

import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
    if (stack != null)
    {
        GlStateManager.pushMatrix();
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        }
        else
        {
            this.renderModel(model, stack);

            if (stack.hasEffect())
            {
                this.renderEffect(model);
            }
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:RenderItem.java

示例3: renderItem

import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public void renderItem(ItemStack stack, IBakedModel model)
{
    if (!stack.func_190926_b())
    {
        GlStateManager.pushMatrix();
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        }
        else
        {
            if (Config.isCustomItems())
            {
                model = CustomItems.getCustomItemModel(stack, model, this.modelLocation);
                this.modelLocation = null;
            }

            this.renderModel(model, stack);

            if (stack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model)))
            {
                this.renderEffect(model);
            }
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:RenderItem.java

示例4: renderItemIntoGUI

import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void renderItemIntoGUI(ItemStack stack, int x, int y, int gl) {
    GlStateManager.pushMatrix();
    RenderHelper.enableGUIStandardItemLighting();
    RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    IBakedModel bakedmodel = renderItem.getItemModelWithOverrides(stack, null, null);
    GlStateManager.translate((float) x, (float) y, 100.0F + renderItem.zLevel);
    GlStateManager.translate(8.0F, 8.0F, 0.0F);
    GlStateManager.scale(1.0F, -1.0F, 1.0F);
    GlStateManager.scale(16.0F, 16.0F, 16.0F);
    if (bakedmodel.isGui3d()) {
        GlStateManager.enableLighting();
    } else {
        GlStateManager.disableLighting();
    }
    bakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(bakedmodel, ItemCameraTransforms.TransformType.GUI, false);
    if (!stack.isEmpty()) {
        GlStateManager.pushMatrix();
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);
        if (bakedmodel.isBuiltInRenderer()) {
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        } else {
            Tessellator tessellator = Tessellator.getInstance();
            BufferBuilder vertexbuffer = tessellator.getBuffer();
            vertexbuffer.begin(gl, DefaultVertexFormats.ITEM);
            for (EnumFacing enumfacing : EnumFacing.values()) {
                renderQuads(vertexbuffer, bakedmodel.getQuads(null, enumfacing, 0L), -1, stack);
            }
            renderQuads(vertexbuffer, bakedmodel.getQuads(null, null, 0L), -1, stack);
            tessellator.draw();
        }
        GlStateManager.popMatrix();
    }
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:51,代码来源:ItemStackUtils.java


注:本文中的net.minecraft.client.renderer.block.model.IBakedModel.isBuiltInRenderer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。