Java 类net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer 实例源码

项目:CustomWorldGen    文件:RenderItem.java   
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();
    }
}
项目:ExpandedRailsMod    文件:RenderItem.java   
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();
    }
}
项目:DecompiledMinecraft    文件:RenderItem.java   
public void renderItem(ItemStack stack, IBakedModel model)
{
    if (stack != null)
    {
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.5F, 0.5F, 0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        }
        else
        {
            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            this.renderModel(model, stack);

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

        GlStateManager.popMatrix();
    }
}
项目:BaseClient    文件:RenderItem.java   
public void renderItem(ItemStack stack, IBakedModel model)
{
    if (stack != null)
    {
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.5F, 0.5F, 0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            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);
            }

            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            this.renderModel(model, stack);

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

        GlStateManager.popMatrix();
    }
}
项目:BaseClient    文件:RenderItem.java   
public void renderItem(ItemStack stack, IBakedModel model)
{
    if (stack != null)
    {
        GlStateManager.pushMatrix();
        GlStateManager.scale(0.5F, 0.5F, 0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        }
        else
        {
            GlStateManager.translate(-0.5F, -0.5F, -0.5F);
            this.renderModel(model, stack);

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

        GlStateManager.popMatrix();
    }
}
项目:Backmemed    文件:RenderItem.java   
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();
    }
}
项目:SasaLib    文件:TileRenderAdvanced.java   
public boolean render(TileEntityItemStackRenderer renderer, ItemStack stack)
{
    for(int i = 0; i < rendererList.size(); i++)
    {
        boolean result = rendererList.get(i).render(stack);
        if(result)
            return true;
    }
    return false;
}
项目:SecurityCraft    文件:ClientProxy.java   
@Override
@SideOnly(Side.CLIENT)
public void registerRenderThings(){
    KeyBindings.init();

    RenderingRegistry.registerEntityRenderingHandler(EntityBouncingBetty.class, new RenderBouncingBetty(Minecraft.getMinecraft().getRenderManager()));
    RenderingRegistry.registerEntityRenderingHandler(EntityIMSBomb.class, new RenderIMSBomb(Minecraft.getMinecraft().getRenderManager()));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityKeypadChest.class, new TileEntityKeypadChestRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySecurityCamera.class, new TileEntitySecurityCameraRenderer());

    TileEntityItemStackRenderer.instance = new ItemKeypadChestRenderer();
}
项目:SecurityCraft    文件:ClientProxy.java   
@Override
@SideOnly(Side.CLIENT)
public void registerRenderThings(){
    KeyBindings.init();

    RenderingRegistry.registerEntityRenderingHandler(EntityBouncingBetty.class, new RenderBouncingBetty(Minecraft.getMinecraft().getRenderManager()));
    RenderingRegistry.registerEntityRenderingHandler(EntityIMSBomb.class, new RenderIMSBomb(Minecraft.getMinecraft().getRenderManager()));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityKeypadChest.class, new TileEntityKeypadChestRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySecurityCamera.class, new TileEntitySecurityCameraRenderer());

    TileEntityItemStackRenderer.instance = new ItemKeypadChestRenderer();
}
项目:Industrial-Foregoing    文件:ItemStackUtils.java   
@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();
}
项目:DecompiledMinecraft    文件:ChestRenderer.java   
public void renderChestBrightness(Block p_178175_1_, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(p_178175_1_));
}
项目:BaseClient    文件:ChestRenderer.java   
public void renderChestBrightness(Block p_178175_1_, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(p_178175_1_));
}
项目:BaseClient    文件:ChestRenderer.java   
public void renderChestBrightness(Block p_178175_1_, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(p_178175_1_));
}
项目:Backmemed    文件:ChestRenderer.java   
public void renderChestBrightness(Block blockIn, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(blockIn));
}
项目:CustomWorldGen    文件:ChestRenderer.java   
public void renderChestBrightness(Block blockIn, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(blockIn));
}
项目:BrokkGUI    文件:GuiRenderItemHelper.java   
public void renderItemStack(ItemStack stack, int x, int y, Color color)
{
    IBakedModel model = this.getRenderItem().getItemModelMesher().getItemModel(stack);
    model = model.getOverrides().handleItemState(model, stack, null, Minecraft.getMinecraft().player);

    GlStateManager.pushMatrix();
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    this.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);
    this.setupGuiTransform(x, y, model.isGui3d(), 50);
    model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(model,
            ItemCameraTransforms.TransformType.GUI, false);

    if (!stack.isEmpty())
    {
        GlStateManager.pushMatrix();
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);

        if (model.isBuiltInRenderer())
        {
            GlStateManager.color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
            GlStateManager.enableRescaleNormal();
            TileEntityItemStackRenderer.instance.renderByItem(stack);
        }
        else
        {
            this.renderModel(model, color.toRGBAInt(), stack);

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

        GlStateManager.popMatrix();
    }
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    this.mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
项目:TechStack-s-HeavyMachineryMod    文件:TileEntityCrateRenderer.java   
@Override
public void render(TileEntity tileentity, double x, double y, double z, float f, int i, float a) {

    Tessellator tessellator = Tessellator.getInstance();

    // Minecraft.getMinecraft().entityRenderer.enableLightMap() and
    // .disableLightMap(),

    GL11.glPushMatrix();

    // GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    GL11.glTranslated(x + .5f, y, z + .5f);
    GL11.glScalef(.5F, .5F, .5F);
    this.bindTexture(getResourceLocation());

    this.teModel.render(tileentity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
    GL11.glScalef(2f, 2f, 2f);
    // GL11.glScalef(2f, 2f, 2f);
    // GL11.glTranslated(-.5f, .5f, -.5f);
    // ((ModelTractor) this.modelTractor).renderGroupObject("Plow_Cube");
    // GL11.glDisableClientState(GL11.GL_LIGHTING);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    String str = "";
    if (tileentity instanceof TileEntityCrate) {
        TileEntityCrate te = (TileEntityCrate) tileentity;
        int count = 0;
        int inventoryIndex = 0;
        ItemStack is = te.getStackInSlot(inventoryIndex);
        if (is != null && !is.isEmpty()) {
            str = FormatAmount(is.getCount() + te.AmtInReserve);
            // EntityItem customitem = new EntityItem(eDT.worldObj);
            // customitem.hoverStart = 0f;
            // customitem.setEntityItemStack(is);
            IBakedModel ibakedmodel = itemRenderer.getItemModelMesher().getItemModel(is);
            GL11.glRotatef(te.rotAmt, 0, 1, 0);

            GlStateManager.translate(-.25F, 0.05F, -.25F);
            GL11.glScalef(.5F, .5F, .5F);
            //

            GlStateManager.enableRescaleNormal();
            if (ibakedmodel.isBuiltInRenderer()) {

                TileEntityItemStackRenderer.instance.renderByItem(is);

            } else {
                BufferBuilder worldrenderer = tessellator.getBuffer();
                worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
                this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
                EnumFacing[] aenumfacing = EnumFacing.values();
                int j = aenumfacing.length;

                for (int k = 0; k < j; ++k) {
                    EnumFacing enumfacing = aenumfacing[k];
                    this.RenderHelper_a(worldrenderer, ibakedmodel.getQuads(null, enumfacing, 0), -1, is);

                }
                this.RenderHelper_a(worldrenderer, ibakedmodel.getQuads(null, null, 0), -1, is);
                tessellator.draw();
            }

        }
        GL11.glPopMatrix();
        float f2 = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        // String str = "" + is.stackSize;
        Entity entity = this.rendererDispatcher.entity;
        double d0 = te.getDistanceSq(entity.posX, entity.posY, entity.posZ);
        // the 400 on the next line is the square of 20 *20 // save 1 math operation by pre calc
        if (d0 <= (double) (400) && Minecraft.getMinecraft().player.isSneaking()) {
            if (!str.equals("")) {
                EntityRenderer.drawNameplate(this.renderManager.getFontRenderer(), str, (float) x + .5f, (float) y + .75f, (float) z + .5f, 0, f2, f1, flag1, false);
            }
        }
    }

}
项目:TechStack-s-HeavyMachineryMod    文件:RenderExcavator.java   
@Override
public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) {

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);

    this.bindEntityTexture(entity);

    this.modelExcavator.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    GlStateManager.translate(-1.00f, -1.75F, -.85F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glScalef(.5f, .5f, .5f);
    EntityExcavator eL = ((EntityExcavator) entity);

    boolean even = true;
    int count = 0;
    for (int i = 0; i < eL.SIZE; i++) {
        ItemStack is = eL.inventory.getStackInSlot(i);
        if (!is.isEmpty()) {
            // EntityItem customitem = new EntityItem(eDT.worldObj);
            // customitem.hoverStart = 0f;
            // customitem.setEntityItemStack(is);
            IBakedModel ibakedmodel = itemRenderer.getItemModelMesher().getItemModel(is);

            if (count > 4) {
                count = 0;
                GlStateManager.translate(-3.0f, 0.0F, 0F);
                GlStateManager.translate(0, 0.5F, .5F);

            }
            GlStateManager.translate(.5F, 0.0F, 0F);
            count += 1;

            GL11.glRotatef(45, 1, 1, 0);

            GlStateManager.enableRescaleNormal();

            if (ibakedmodel.isBuiltInRenderer()) {

                TileEntityItemStackRenderer.instance.renderByItem(is);

            } else {
                Tessellator tessellator = Tessellator.getInstance();
                BufferBuilder worldrenderer = tessellator.getBuffer();
                worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
                this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
                EnumFacing[] aenumfacing = EnumFacing.values();
                int j = aenumfacing.length;

                for (int k = 0; k < j; ++k) {
                    EnumFacing enumfacing = aenumfacing[k];
                    this.RenderHelper_a(worldrenderer, ibakedmodel.getQuads(null, enumfacing, 0), -1, is);

                }

                this.RenderHelper_a(worldrenderer, ibakedmodel.getQuads(null, null, 0), -1, is);
                tessellator.draw();
            }
            GL11.glRotatef(-45, 1, 1, 0);
            even = !even;
        }
    }

    GL11.glPopMatrix();
}
项目:SasaLib    文件:TileRenderAdvanced.java   
public static boolean renderByItem(TileEntityItemStackRenderer renderer, ItemStack stack)
{
    return INSTANCE.render(renderer, stack);
}
项目:ExpandedRailsMod    文件:ChestRenderer.java   
public void renderChestBrightness(Block blockIn, float color)
{
    GlStateManager.color(color, color, color, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(blockIn));
}
项目:SecurityCraft    文件:ClientProxy.java   
@Override
@SideOnly(Side.CLIENT)
public void registerRenderThings(){
    KeyBindings.init();

    RenderingRegistry.registerEntityRenderingHandler(EntityBouncingBetty.class, new RenderBouncingBetty(Minecraft.getMinecraft().getRenderManager()));
    RenderingRegistry.registerEntityRenderingHandler(EntityIMSBomb.class, new RenderIMSBomb(Minecraft.getMinecraft().getRenderManager()));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityKeypadChest.class, new TileEntityKeypadChestRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySecurityCamera.class, new TileEntitySecurityCameraRenderer());

    TileEntityItemStackRenderer.instance = new ItemKeypadChestRenderer();

    Block[] blocksToTint = {
            SCContent.reinforcedBrick,
            SCContent.reinforcedCobblestone,
            SCContent.reinforcedCompressedBlocks,
            SCContent.reinforcedDirt,
            SCContent.reinforcedDoubleStoneSlabs,
            SCContent.reinforcedDoubleStoneSlabs2,
            SCContent.reinforcedDoubleWoodSlabs,
            SCContent.reinforcedEndStoneBricks,
            SCContent.reinforcedHardenedClay,
            SCContent.reinforcedMetals,
            SCContent.reinforcedMossyCobblestone,
            SCContent.reinforcedNetherBrick,
            SCContent.reinforcedNewLogs,
            SCContent.reinforcedOldLogs,
            SCContent.reinforcedPrismarine,
            SCContent.reinforcedPurpur,
            SCContent.reinforcedQuartz,
            SCContent.reinforcedRedNetherBrick,
            SCContent.reinforcedRedSandstone,
            SCContent.reinforcedSandstone,
            SCContent.reinforcedStainedHardenedClay,
            SCContent.reinforcedStairsAcacia,
            SCContent.reinforcedStairsBirch,
            SCContent.reinforcedStairsBrick,
            SCContent.reinforcedStairsCobblestone,
            SCContent.reinforcedStairsDarkoak,
            SCContent.reinforcedStairsJungle,
            SCContent.reinforcedStairsNetherBrick,
            SCContent.reinforcedStairsOak,
            SCContent.reinforcedStairsPurpur,
            SCContent.reinforcedStairsQuartz,
            SCContent.reinforcedStairsRedSandstone,
            SCContent.reinforcedStairsSandstone,
            SCContent.reinforcedStairsSpruce,
            SCContent.reinforcedStairsStone,
            SCContent.reinforcedStairsStoneBrick,
            SCContent.reinforcedStone,
            SCContent.reinforcedStoneBrick,
            SCContent.reinforcedStoneSlabs,
            SCContent.reinforcedStoneSlabs2,
            SCContent.reinforcedWoodPlanks,
            SCContent.reinforcedWoodSlabs,
            SCContent.reinforcedWool
    };
    //registering reinforced blocks color overlay for world
    Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, worldIn, pos, tintIndex) -> 0x999999, blocksToTint);
    //same thing for inventory
    Minecraft.getMinecraft().getItemColors().registerItemColorHandler((IItemColor)(stack, tintIndex) -> 0x999999, blocksToTint);
}
项目:SecurityCraft    文件:ClientProxy.java   
@Override
@SideOnly(Side.CLIENT)
public void registerRenderThings(){
    KeyBindings.init();

    RenderingRegistry.registerEntityRenderingHandler(EntityBouncingBetty.class, new RenderBouncingBetty(Minecraft.getMinecraft().getRenderManager()));
    RenderingRegistry.registerEntityRenderingHandler(EntityIMSBomb.class, new RenderIMSBomb(Minecraft.getMinecraft().getRenderManager()));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityKeypadChest.class, new TileEntityKeypadChestRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySecurityCamera.class, new TileEntitySecurityCameraRenderer());

    TileEntityItemStackRenderer.instance = new ItemKeypadChestRenderer();

    Block[] blocksToTint = {
            SCContent.reinforcedBrick,
            SCContent.reinforcedCobblestone,
            SCContent.reinforcedCompressedBlocks,
            SCContent.reinforcedDirt,
            SCContent.reinforcedDoubleStoneSlabs,
            SCContent.reinforcedDoubleStoneSlabs2,
            SCContent.reinforcedDoubleWoodSlabs,
            SCContent.reinforcedEndStoneBricks,
            SCContent.reinforcedHardenedClay,
            SCContent.reinforcedMetals,
            SCContent.reinforcedMossyCobblestone,
            SCContent.reinforcedNetherBrick,
            SCContent.reinforcedNewLogs,
            SCContent.reinforcedOldLogs,
            SCContent.reinforcedPrismarine,
            SCContent.reinforcedPurpur,
            SCContent.reinforcedQuartz,
            SCContent.reinforcedRedNetherBrick,
            SCContent.reinforcedRedSandstone,
            SCContent.reinforcedSandstone,
            SCContent.reinforcedStainedHardenedClay,
            SCContent.reinforcedStairsAcacia,
            SCContent.reinforcedStairsBirch,
            SCContent.reinforcedStairsBrick,
            SCContent.reinforcedStairsCobblestone,
            SCContent.reinforcedStairsDarkoak,
            SCContent.reinforcedStairsJungle,
            SCContent.reinforcedStairsNetherBrick,
            SCContent.reinforcedStairsOak,
            SCContent.reinforcedStairsPurpur,
            SCContent.reinforcedStairsQuartz,
            SCContent.reinforcedStairsRedSandstone,
            SCContent.reinforcedStairsSandstone,
            SCContent.reinforcedStairsSpruce,
            SCContent.reinforcedStairsStone,
            SCContent.reinforcedStairsStoneBrick,
            SCContent.reinforcedStone,
            SCContent.reinforcedStoneBrick,
            SCContent.reinforcedStoneSlabs,
            SCContent.reinforcedStoneSlabs2,
            SCContent.reinforcedWoodPlanks,
            SCContent.reinforcedWoodSlabs,
            SCContent.reinforcedWool
    };
    //registering reinforced blocks color overlay for world
    Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, worldIn, pos, tintIndex) -> 0x999999, blocksToTint);
    //same thing for inventory
    Minecraft.getMinecraft().getItemColors().registerItemColorHandler((IItemColor)(stack, tintIndex) -> 0x999999, blocksToTint);
}
项目:SecurityCraft    文件:ClientProxy.java   
@Override
@SideOnly(Side.CLIENT)
public void registerRenderThings(){
    KeyBindings.init();

    RenderingRegistry.registerEntityRenderingHandler(EntityBouncingBetty.class, new RenderBouncingBetty(Minecraft.getMinecraft().getRenderManager()));
    RenderingRegistry.registerEntityRenderingHandler(EntityIMSBomb.class, new RenderIMSBomb(Minecraft.getMinecraft().getRenderManager()));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityKeypadChest.class, new TileEntityKeypadChestRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySecurityCamera.class, new TileEntitySecurityCameraRenderer());

    TileEntityItemStackRenderer.instance = new ItemKeypadChestRenderer();

    Block[] blocksToTint = {
            SCContent.reinforcedBrick,
            SCContent.reinforcedCobblestone,
            SCContent.reinforcedCompressedBlocks,
            SCContent.reinforcedConcrete,
            SCContent.reinforcedDirt,
            SCContent.reinforcedDoubleStoneSlabs,
            SCContent.reinforcedDoubleStoneSlabs2,
            SCContent.reinforcedDoubleWoodSlabs,
            SCContent.reinforcedEndStoneBricks,
            SCContent.reinforcedHardenedClay,
            SCContent.reinforcedMetals,
            SCContent.reinforcedMossyCobblestone,
            SCContent.reinforcedNetherBrick,
            SCContent.reinforcedNewLogs,
            SCContent.reinforcedOldLogs,
            SCContent.reinforcedPrismarine,
            SCContent.reinforcedPurpur,
            SCContent.reinforcedQuartz,
            SCContent.reinforcedRedNetherBrick,
            SCContent.reinforcedRedSandstone,
            SCContent.reinforcedSandstone,
            SCContent.reinforcedStainedHardenedClay,
            SCContent.reinforcedStairsAcacia,
            SCContent.reinforcedStairsBirch,
            SCContent.reinforcedStairsBrick,
            SCContent.reinforcedStairsCobblestone,
            SCContent.reinforcedStairsDarkoak,
            SCContent.reinforcedStairsJungle,
            SCContent.reinforcedStairsNetherBrick,
            SCContent.reinforcedStairsOak,
            SCContent.reinforcedStairsPurpur,
            SCContent.reinforcedStairsQuartz,
            SCContent.reinforcedStairsRedSandstone,
            SCContent.reinforcedStairsSandstone,
            SCContent.reinforcedStairsSpruce,
            SCContent.reinforcedStairsStone,
            SCContent.reinforcedStairsStoneBrick,
            SCContent.reinforcedStone,
            SCContent.reinforcedStoneBrick,
            SCContent.reinforcedStoneSlabs,
            SCContent.reinforcedStoneSlabs2,
            SCContent.reinforcedWoodPlanks,
            SCContent.reinforcedWoodSlabs,
            SCContent.reinforcedWool
    };
    //registering reinforced blocks color overlay for world
    Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, worldIn, pos, tintIndex) -> 0x999999, blocksToTint);
    //same thing for inventory
    Minecraft.getMinecraft().getItemColors().registerItemColorHandler((IItemColor)(stack, tintIndex) -> 0x999999, blocksToTint);
}
项目:iChunUtil    文件:RendererHelper.java   
public static void renderBakedModel(IBakedModel model, int color, ItemStack stack)
{
    Minecraft mc = Minecraft.getMinecraft();

    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);

    //renderItem

    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
    {
        renderModel(model, color, stack);

        if(stack.hasEffect())
        {
            GlStateManager.depthMask(false);
            GlStateManager.depthFunc(GL11.GL_EQUAL);
            GlStateManager.disableLighting();
            GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_COLOR, GlStateManager.DestFactor.ONE);
            mc.getTextureManager().bindTexture(ResourceHelper.texGlint);
            GlStateManager.matrixMode(GL11.GL_TEXTURE);
            GlStateManager.pushMatrix();
            GlStateManager.scale(8.0F, 8.0F, 8.0F);
            float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;
            GlStateManager.translate(f, 0.0F, 0.0F);
            GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F);
            renderModel(model, -8372020, null);
            GlStateManager.popMatrix();
            GlStateManager.pushMatrix();
            GlStateManager.scale(8.0F, 8.0F, 8.0F);
            float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F;
            GlStateManager.translate(-f1, 0.0F, 0.0F);
            GlStateManager.rotate(10.0F, 0.0F, 0.0F, 1.0F);
            renderModel(model, -8372020, null);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(GL11.GL_MODELVIEW);
            GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
            GlStateManager.enableLighting();
            GlStateManager.depthFunc(GL11.GL_LEQUAL);
            GlStateManager.depthMask(true);
            mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        }
    }

    GlStateManager.popMatrix();

    //end renderItem

    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    mc.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}