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


Java EntityItemFrame.getDisplayedItem方法代碼示例

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


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

示例1: doRender

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
 */
public void doRender(EntityItemFrame par1EntityItemFrame, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    double var10 = par1EntityItemFrame.posX - par2 - 0.5D;
    double var12 = par1EntityItemFrame.posY - par4 - 0.5D;
    double var14 = par1EntityItemFrame.posZ - par6 - 0.5D;
    int var16 = par1EntityItemFrame.field_146063_b + Direction.offsetX[par1EntityItemFrame.hangingDirection];
    int var17 = par1EntityItemFrame.field_146064_c;
    int var18 = par1EntityItemFrame.field_146062_d + Direction.offsetZ[par1EntityItemFrame.hangingDirection];
    GL11.glTranslated((double)var16 - var10, (double)var17 - var12, (double)var18 - var14);

    if (par1EntityItemFrame.getDisplayedItem() != null && par1EntityItemFrame.getDisplayedItem().getItem() == Items.filled_map)
    {
        this.func_147915_b(par1EntityItemFrame);
    }
    else
    {
        this.renderFrameItemAsBlock(par1EntityItemFrame);
    }

    this.func_82402_b(par1EntityItemFrame);
    GL11.glPopMatrix();
    this.func_147914_a(par1EntityItemFrame, par2 + (double)((float)Direction.offsetX[par1EntityItemFrame.hangingDirection] * 0.3F), par4 - 0.25D, par6 + (double)((float)Direction.offsetZ[par1EntityItemFrame.hangingDirection] * 0.3F));
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:31,代碼來源:RenderItemFrame.java

示例2: doRender

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
public void doRender(EntityItemFrame p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
    GL11.glPushMatrix();
    double d3 = p_76986_1_.posX - p_76986_2_ - 0.5D;
    double d4 = p_76986_1_.posY - p_76986_4_ - 0.5D;
    double d5 = p_76986_1_.posZ - p_76986_6_ - 0.5D;
    int i = p_76986_1_.field_146063_b + Direction.offsetX[p_76986_1_.hangingDirection];
    int j = p_76986_1_.field_146064_c;
    int k = p_76986_1_.field_146062_d + Direction.offsetZ[p_76986_1_.hangingDirection];
    GL11.glTranslated((double)i - d3, (double)j - d4, (double)k - d5);

    if (p_76986_1_.getDisplayedItem() != null && p_76986_1_.getDisplayedItem().getItem() == Items.filled_map)
    {
        this.func_147915_b(p_76986_1_);
    }
    else
    {
        this.renderFrameItemAsBlock(p_76986_1_);
    }

    this.func_82402_b(p_76986_1_);
    GL11.glPopMatrix();
    this.func_147914_a(p_76986_1_, p_76986_2_ + (double)((float)Direction.offsetX[p_76986_1_.hangingDirection] * 0.3F), p_76986_4_ - 0.25D, p_76986_6_ + (double)((float)Direction.offsetZ[p_76986_1_.hangingDirection] * 0.3F));
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:25,代碼來源:RenderItemFrame.java

示例3: doRender

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
@Override
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    ItemStack frameItemStack = ItemStack.EMPTY;

    if (!CheckVisibleState(entity))
    {
        frameItemStack = entity.getDisplayedItem();
        entity.setDisplayedItem(ItemStack.EMPTY);
    }

    if ((!SkipSignCore.ModSetting.HideBoard.Bool()) ||
        (SkipSignCore.ModSetting.HideBoard.Bool() && CheckVisibleState(entity)))
    {
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }

    if (!frameItemStack.isEmpty())
    {
        entity.setDisplayedItem(frameItemStack);
    }
}
 
開發者ID:TTTA2,項目名稱:SkipSignGUI,代碼行數:23,代碼來源:RenderItemFrameEx.java

示例4: doRender

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    BlockPos blockpos = entity.getHangingPosition();
    double d0 = (double)blockpos.getX() - entity.posX + x;
    double d1 = (double)blockpos.getY() - entity.posY + y;
    double d2 = (double)blockpos.getZ() - entity.posZ + z;
    GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D);
    GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
    this.renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    IBakedModel ibakedmodel;

    if (entity.getDisplayedItem() != null && entity.getDisplayedItem().getItem() == Items.filled_map)
    {
        ibakedmodel = modelmanager.getModel(this.mapModel);
    }
    else
    {
        ibakedmodel = modelmanager.getModel(this.itemFrameModel);
    }

    GlStateManager.pushMatrix();
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.popMatrix();
    GlStateManager.translate(0.0F, 0.0F, 0.4375F);
    this.renderItem(entity);
    GlStateManager.popMatrix();
    this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:39,代碼來源:RenderItemFrame.java

示例5: renderName

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        double d0 = entity.getDistanceSqToEntity(this.renderManager.renderViewEntity);
        float f = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f * f))
        {
            String s = entity.getDisplayedItem().getDisplayName();
            this.renderLivingLabel(entity, s, x, y, z, 64);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:RenderItemFrame.java

示例6: renderName

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        float f = 1.6F;
        float f1 = 0.016666668F * f;
        double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float f2 = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f2 * f2))
        {
            String s = entity.getDisplayedItem().getDisplayName();

            if (entity.isSneaking())
            {
                FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                GlStateManager.pushMatrix();
                GlStateManager.translate((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GlStateManager.scale(-f1, -f1, f1);
                GlStateManager.disableLighting();
                GlStateManager.translate(0.0F, 0.25F / f1, 0.0F);
                GlStateManager.depthMask(false);
                GlStateManager.enableBlend();
                GlStateManager.blendFunc(770, 771);
                Tessellator tessellator = Tessellator.getInstance();
                WorldRenderer worldrenderer = tessellator.getWorldRenderer();
                int i = fontrenderer.getStringWidth(s) / 2;
                GlStateManager.disableTexture2D();
                worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                tessellator.draw();
                GlStateManager.enableTexture2D();
                GlStateManager.depthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                GlStateManager.enableLighting();
                GlStateManager.disableBlend();
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                GlStateManager.popMatrix();
            }
            else
            {
                this.renderLivingLabel(entity, s, x, y, z, 64);
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:53,代碼來源:RenderItemFrame.java

示例7: renderItem

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
    ItemStack itemstack = itemFrame.getDisplayedItem();

    if (!itemstack.func_190926_b())
    {
        if (!Config.zoomMode)
        {
            Entity entity = this.mc.player;
            double d0 = itemFrame.getDistanceSq(entity.posX, entity.posY, entity.posZ);

            if (d0 > 4096.0D)
            {
                return;
            }
        }

        EntityItem entityitem = new EntityItem(itemFrame.world, 0.0D, 0.0D, 0.0D, itemstack);
        Item item = entityitem.getEntityItem().getItem();
        entityitem.getEntityItem().func_190920_e(1);
        entityitem.hoverStart = 0.0F;
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();
        int i = itemFrame.getRotation();

        if (item instanceof ItemMap)
        {
            i = i % 4 * 2;
        }

        GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);

        if (!Reflector.postForgeBusEvent(Reflector.RenderItemInFrameEvent_Constructor, new Object[] {itemFrame, this}))
        {
            if (item instanceof ItemMap)
            {
                this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
                GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
                float f = 0.0078125F;
                GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
                GlStateManager.translate(-64.0F, -64.0F, 0.0F);
                MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getEntityItem(), itemFrame.world);
                GlStateManager.translate(0.0F, 0.0F, -1.0F);

                if (mapdata != null)
                {
                    this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
                }
            }
            else
            {
                GlStateManager.scale(0.5F, 0.5F, 0.5F);
                GlStateManager.pushAttrib();
                RenderHelper.enableStandardItemLighting();
                this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
                RenderHelper.disableStandardItemLighting();
                GlStateManager.popAttrib();
            }
        }
        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
    }

    if (Config.isShaders())
    {
        ShadersTex.updatingTex = null;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:69,代碼來源:RenderItemFrame.java

示例8: RenderItemInFrameEvent

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
public RenderItemInFrameEvent(EntityItemFrame itemFrame, RenderItemFrame renderItemFrame)
{
    item = itemFrame.getDisplayedItem();
    entityItemFrame = itemFrame;
    renderer = renderItemFrame;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:7,代碼來源:RenderItemInFrameEvent.java

示例9: doRender

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    BlockPos blockpos = entity.getHangingPosition();
    double d0 = (double)blockpos.getX() - entity.posX + x;
    double d1 = (double)blockpos.getY() - entity.posY + y;
    double d2 = (double)blockpos.getZ() - entity.posZ + z;
    GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D);
    GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
    this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    IBakedModel ibakedmodel;

    if (entity.getDisplayedItem() != null && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
    {
        ibakedmodel = modelmanager.getModel(this.mapModel);
    }
    else
    {
        ibakedmodel = modelmanager.getModel(this.itemFrameModel);
    }

    GlStateManager.pushMatrix();
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    GlStateManager.translate(0.0F, 0.0F, 0.4375F);
    this.renderItem(entity);
    GlStateManager.popMatrix();
    this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:50,代碼來源:RenderItemFrame.java

示例10: renderItem

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
private void renderItem(EntityItemFrame itemFrame)
{
    ItemStack itemstack = itemFrame.getDisplayedItem();

    if (itemstack != null)
    {
        EntityItem entityitem = new EntityItem(itemFrame.worldObj, 0.0D, 0.0D, 0.0D, itemstack);
        Item item = entityitem.getEntityItem().getItem();
        entityitem.getEntityItem().stackSize = 1;
        entityitem.hoverStart = 0.0F;
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();
        int i = itemFrame.getRotation();

        if (item instanceof net.minecraft.item.ItemMap)
        {
            i = i % 4 * 2;
        }

        GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);

        net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(itemFrame, this);
        if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
        {
        if (item instanceof net.minecraft.item.ItemMap)
        {
            this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
            float f = 0.0078125F;
            GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
            GlStateManager.translate(-64.0F, -64.0F, 0.0F);
            MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getEntityItem(), itemFrame.worldObj);
            GlStateManager.translate(0.0F, 0.0F, -1.0F);

            if (mapdata != null)
            {
                this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
            }
        }
        else
        {
            GlStateManager.scale(0.5F, 0.5F, 0.5F);

            if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getEntityItem()) || item instanceof ItemSkull)
            {
                GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            }

            GlStateManager.pushAttrib();
            RenderHelper.enableStandardItemLighting();
            this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
            RenderHelper.disableStandardItemLighting();
            GlStateManager.popAttrib();
        }
        }

        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:61,代碼來源:RenderItemFrame.java

示例11: func_147914_a

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
protected void func_147914_a(EntityItemFrame p_147914_1_, double p_147914_2_, double p_147914_4_, double p_147914_6_)
{
    if (Minecraft.isGuiEnabled() && p_147914_1_.getDisplayedItem() != null && p_147914_1_.getDisplayedItem().hasDisplayName() && this.renderManager.field_147941_i == p_147914_1_)
    {
        float var8 = 1.6F;
        float var9 = 0.016666668F * var8;
        double var10 = p_147914_1_.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float var12 = p_147914_1_.isSneaking() ? 32.0F : 64.0F;

        if (var10 < (double)(var12 * var12))
        {
            String var13 = p_147914_1_.getDisplayedItem().getDisplayName();

            if (p_147914_1_.isSneaking())
            {
                FontRenderer var14 = this.getFontRendererFromRenderManager();
                GL11.glPushMatrix();
                GL11.glTranslatef((float)p_147914_2_ + 0.0F, (float)p_147914_4_ + p_147914_1_.height + 0.5F, (float)p_147914_6_);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GL11.glScalef(-var9, -var9, var9);
                GL11.glDisable(GL11.GL_LIGHTING);
                GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F);
                GL11.glDepthMask(false);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                Tessellator var15 = Tessellator.instance;
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                var15.startDrawingQuads();
                int var16 = var14.getStringWidth(var13) / 2;
                var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
                var15.addVertex((double)(-var16 - 1), -1.0D, 0.0D);
                var15.addVertex((double)(-var16 - 1), 8.0D, 0.0D);
                var15.addVertex((double)(var16 + 1), 8.0D, 0.0D);
                var15.addVertex((double)(var16 + 1), -1.0D, 0.0D);
                var15.draw();
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glDepthMask(true);
                var14.drawString(var13, -var14.getStringWidth(var13) / 2, 0, 553648127);
                GL11.glEnable(GL11.GL_LIGHTING);
                GL11.glDisable(GL11.GL_BLEND);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glPopMatrix();
            }
            else
            {
            }
        }
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:52,代碼來源:RenderItemFrame.java

示例12: func_147914_a

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
protected void func_147914_a(EntityItemFrame p_147914_1_, double p_147914_2_, double p_147914_4_, double p_147914_6_)
{
    if (Minecraft.isGuiEnabled() && p_147914_1_.getDisplayedItem() != null && p_147914_1_.getDisplayedItem().hasDisplayName() && this.renderManager.field_147941_i == p_147914_1_)
    {
        float f = 1.6F;
        float f1 = 0.016666668F * f;
        double d3 = p_147914_1_.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float f2 = p_147914_1_.isSneaking() ? 32.0F : 64.0F;

        if (d3 < (double)(f2 * f2))
        {
            String s = p_147914_1_.getDisplayedItem().getDisplayName();

            if (p_147914_1_.isSneaking())
            {
                FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                GL11.glPushMatrix();
                GL11.glTranslatef((float)p_147914_2_ + 0.0F, (float)p_147914_4_ + p_147914_1_.height + 0.5F, (float)p_147914_6_);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GL11.glScalef(-f1, -f1, f1);
                GL11.glDisable(GL11.GL_LIGHTING);
                GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F);
                GL11.glDepthMask(false);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                Tessellator tessellator = Tessellator.instance;
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                tessellator.startDrawingQuads();
                int i = fontrenderer.getStringWidth(s) / 2;
                tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
                tessellator.addVertex((double)(-i - 1), -1.0D, 0.0D);
                tessellator.addVertex((double)(-i - 1), 8.0D, 0.0D);
                tessellator.addVertex((double)(i + 1), 8.0D, 0.0D);
                tessellator.addVertex((double)(i + 1), -1.0D, 0.0D);
                tessellator.draw();
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glDepthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                GL11.glEnable(GL11.GL_LIGHTING);
                GL11.glDisable(GL11.GL_BLEND);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glPopMatrix();
            }
            else
            {
                this.func_147906_a(p_147914_1_, s, p_147914_2_, p_147914_4_, p_147914_6_, 64);
            }
        }
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:53,代碼來源:RenderItemFrame.java

示例13: getItemStack

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
@Override
protected ItemStack getItemStack(EntityItemFrame entity) {
    return entity.getDisplayedItem();
}
 
開發者ID:boq,項目名稱:cctags,代碼行數:5,代碼來源:EntityItemFrameAccess.java

示例14: collectEntityData

import net.minecraft.entity.item.EntityItemFrame; //導入方法依賴的package包/類
public void collectEntityData(List<String> lines, RayTraceResult ray, Entity entity){
  	String nameLine = entity.getDisplayName().getFormattedText() + " (#"+entity.getEntityId()+")";
lines.add(nameLine);		

  	boolean handledRider = false;
if(entity instanceof EntityItemFrame){
	EntityItemFrame frame = (EntityItemFrame)entity;
	ItemStack item = frame.getDisplayedItem();
	if(ItemStackTools.isEmpty(item)){
		lines.add("Item: "+Lang.localize("gui.empty"));
	} else {
		lines.add("Item: "+item.getDisplayName());
	}
}

  	if(entity instanceof EntityLivingBase){
	EntityLivingBase living = (EntityLivingBase)entity;
	String health = "Health: "+(living.getHealth()+" / "+ living.getMaxHealth());
	lines.add(health);
}
  	
  	if(entity instanceof EntityBoat){
  		EntityBoat boat = (EntityBoat)entity;
  		
  		if(boat.getControllingPassenger() !=null){
  			lines.add("Driver: "+boat.getControllingPassenger().getDisplayName().getFormattedText());
  		} else {
  			lines.add("Driver: "+Lang.localize("gui.empty"));
  		}
  		
  		if(!boat.getPassengers().isEmpty() && boat.getPassengers().size() > 1 && boat.getPassengers().get(1) !=null){
  			lines.add("Passenger: "+boat.getPassengers().get(1).getDisplayName().getFormattedText());
  		} else {
  			lines.add("Passenger: "+Lang.localize("gui.empty"));
  		}
  		handledRider = true;
  	}
  	
  	if(entity instanceof EntityMinecart){
  		EntityMinecart cart = (EntityMinecart)entity;

  		if(cart instanceof EntityMinecartEmpty){
   		if(cart.getControllingPassenger() !=null){
   			lines.add("Rider: "+cart.getControllingPassenger().getDisplayName().getFormattedText());
   		} else {
   			lines.add("Rider: "+Lang.localize("gui.empty"));
   		}
  		}
  		if(cart instanceof EntityMinecartFurnace){
  			EntityMinecartFurnace furnace = (EntityMinecartFurnace)cart;
  			int fuel = ObfuscationReflectionHelper.getPrivateValue(EntityMinecartFurnace.class, furnace, 1);
   		lines.add("Fuel: "+TimeUtil.getTimeFromTicks(fuel));
  		}
  		handledRider = true;
  	}
  	
  	if(entity instanceof IEntityOwnable){
  		IEntityOwnable ownable = (IEntityOwnable)entity;
  		UUID owner = ownable.getOwnerId();
  		if(owner !=null){
  			String name = ProfileUtil.getUsername(owner);
  			if(name != ProfileUtil.ERROR){
  				lines.add("Owner: "+name);
  			}
  		}
  	}
  	
  	if(!handledRider && entity.getControllingPassenger() !=null){
  		lines.add("Rider: "+entity.getControllingPassenger().getDisplayName().getFormattedText());
  	}
  }
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:72,代碼來源:ClientEventHandler.java


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