當前位置: 首頁>>代碼示例>>Java>>正文


Java IBakedModel.isGui3d方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.block.model.IBakedModel.isGui3d方法的典型用法代碼示例。如果您正苦於以下問題:Java IBakedModel.isGui3d方法的具體用法?Java IBakedModel.isGui3d怎麽用?Java IBakedModel.isGui3d使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.block.model.IBakedModel的用法示例。


在下文中一共展示了IBakedModel.isGui3d方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: duplicateModel

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
public static IBakedModel duplicateModel(IBakedModel p_duplicateModel_0_)
{
    List list = duplicateQuadList(p_duplicateModel_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L));
    EnumFacing[] aenumfacing = EnumFacing.VALUES;
    Map<EnumFacing, List<BakedQuad>> map = new HashMap();

    for (int i = 0; i < aenumfacing.length; ++i)
    {
        EnumFacing enumfacing = aenumfacing[i];
        List list1 = p_duplicateModel_0_.getQuads((IBlockState)null, enumfacing, 0L);
        List list2 = duplicateQuadList(list1);
        map.put(enumfacing, list2);
    }

    SimpleBakedModel simplebakedmodel = new SimpleBakedModel(list, map, p_duplicateModel_0_.isAmbientOcclusion(), p_duplicateModel_0_.isGui3d(), p_duplicateModel_0_.getParticleTexture(), p_duplicateModel_0_.getItemCameraTransforms(), p_duplicateModel_0_.getOverrides());
    return simplebakedmodel;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:18,代碼來源:ModelUtils.java

示例2: getCustomItemModel

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
public static IBakedModel getCustomItemModel(ItemStack p_getCustomItemModel_0_, IBakedModel p_getCustomItemModel_1_, ResourceLocation p_getCustomItemModel_2_)
{
    if (p_getCustomItemModel_1_.isGui3d())
    {
        return p_getCustomItemModel_1_;
    }
    else if (itemProperties == null)
    {
        return p_getCustomItemModel_1_;
    }
    else
    {
        CustomItemProperties customitemproperties = getCustomItemProperties(p_getCustomItemModel_0_, 1);
        return customitemproperties == null ? p_getCustomItemModel_1_ : customitemproperties.getModel(p_getCustomItemModel_2_);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:17,代碼來源:CustomItems.java

示例3: renderItemModelIntoGUI

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
private static void renderItemModelIntoGUI(ItemStack stack, double x, double y, IBakedModel bakedmodel, double scale)
{
    GlStateManager.pushMatrix();
    MC.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    MC.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);

    GlStateManager.translate(x, y, 100.0F + MC.getRenderItem().zLevel);
    GlStateManager.translate(8.0F, 8.0F, 0.0F);
    GlStateManager.scale(1.0F, -1.0F, 1.0F);
    GlStateManager.scale(scale, scale, scale);

    if (bakedmodel.isGui3d())
        GlStateManager.enableLighting();
    else
        GlStateManager.disableLighting();

    bakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(bakedmodel, ItemCameraTransforms.TransformType.GUI, false);
    MC.getRenderItem().renderItem(stack, bakedmodel);
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    MC.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:32,代碼來源:SurfaceHelper.java

示例4: preTransform

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
private static void preTransform(RenderItem renderItem, ItemStack stack) {
    IBakedModel ibakedmodel = renderItem.getItemModelMesher().getItemModel(stack);
    Item item = stack.getItem();

    if (item != null) {
        boolean flag = ibakedmodel.isGui3d();

        if (!flag) {
            GlStateManager.scale(2.0F, 2.0F, 2.0F);
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    }
}
 
開發者ID:McJty,項目名稱:Lector,代碼行數:15,代碼來源:RenderHelper.java

示例5: transformModelCount

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
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 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
        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;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:29,代碼來源:RenderEntityItem.java

示例6: transformModelCount

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:29,代碼來源:RenderEntityItem.java

示例7: 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

示例8: shouldRenderItemIn3D

import net.minecraft.client.renderer.block.model.IBakedModel; //導入方法依賴的package包/類
public boolean shouldRenderItemIn3D(ItemStack stack)
{
    IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
    return ibakedmodel == null ? false : ibakedmodel.isGui3d();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:RenderItem.java


注:本文中的net.minecraft.client.renderer.block.model.IBakedModel.isGui3d方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。