Jump to content

[1.16.2] Updating BufferBuilder Translations from 1.12


Recommended Posts

Posted

I have a tile entity that renders a frame buffer to a block with stenciling. I'm attempting to update my mod from 1.12.2 to 1.16.2, and I believe that BufferBuilder.setTranslation was replaced by matrixStack.translate. Can I just replace the buffer builder translations with matrix stack? Or how does that work exactly?

 

Here is my old code:

final Tessellator tessellator = Tessellator.getInstance();
        final BufferBuilder renderer = tessellator.getBuffer();
        renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
        renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
        blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, matrixStackIn, buffer.getBuffer(RenderType.getSolid()), false, new Random(), state.getPositionRandom(te.getPos()), OverlayTexture.NO_OVERLAY);
        tessellator.draw();
        renderer.setTranslation(0, 0, 0);

 

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.