Jump to content

[SOLVED] [1.15.2] How do I prevent items from cutting off map


Recommended Posts

Posted (edited)

I am trying to show a map within the inventory and the map is being cut off by items.

What should I do to fix this?

 

Code:

Spoiler

        RenderSystem.pushMatrix();
        RenderSystem.disableDepthTest();
        mc.getTextureManager().bindTexture(MAP_BACKGROUND);
        BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();
        RenderSystem.translated(x, y + 15.5, 0);
        RenderSystem.scaled(0.5, 0.5, 1);
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
        bufferbuilder.pos(-7, 135, 0).color(255, 255, 255, 255).tex(0, 1).lightmap(240).endVertex();
        bufferbuilder.pos(135, 135, 0).color(255, 255, 255, 255).tex(1, 1).lightmap(240).endVertex();
        bufferbuilder.pos(135, -7, 0).color(255, 255, 255, 255).tex(1, 0).lightmap(240).endVertex();
        bufferbuilder.pos(-7, -7, 0).color(255, 255, 255, 255).tex(0, 0).lightmap(240).endVertex();
        bufferbuilder.finishDrawing();
        RenderSystem.enableAlphaTest();
        WorldVertexBufferUploader.draw(bufferbuilder);

        RenderSystem.translated(0, 0, 1);
        MatrixStack matrixStack = new MatrixStack();
        IRenderTypeBuffer.Impl irendertypebuffer$impl = IRenderTypeBuffer.getImpl(bufferbuilder);
        mc.gameRenderer.getMapItemRenderer().renderMap(matrixStack, irendertypebuffer$impl, mapdata, true, 15728880);
        irendertypebuffer$impl.finish();
        
        RenderSystem.enableDepthTest();
        RenderSystem.popMatrix();

This is inside the GuiScreenEvent.DrawScreenEvent.Post event

 

Annotation 2020-06-16 014010.png

 

Edit: Turns out I just had to increase the z value.

Edited by VendoAU

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.