Update ScreenRenderer.java

This commit is contained in:
Mysticpasta1 2022-06-27 02:47:59 -05:00
parent 5f0de40ad7
commit b68d006e75

View File

@ -122,14 +122,16 @@ public class ScreenRenderer implements BlockEntityRenderer<TileEntityScreen> {
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder builder = tesselator.getBuilder();
VertexBuffer vb = new VertexBuffer();
//TODO: Use tesselator
RenderSystem.setShaderTexture(0, scr.browser.getTextureID());
builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR_TEX);
builder.vertex(-sw, -sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(0.f, 1.f).endVertex();
builder.vertex( sw, -sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(1.f, 1.f).endVertex();
builder.vertex( sw, sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(1.f, 0.f).endVertex();
builder.vertex(-sw, sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(0.f, 0.f).endVertex();
builder.vertex(poseStack.last().pose(),-sw, -sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(0.f, 1.f).endVertex();
builder.vertex(poseStack.last().pose(), sw, -sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(1.f, 1.f).endVertex();
builder.vertex(poseStack.last().pose(), sw, sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(1.f, 0.f).endVertex();
builder.vertex(poseStack.last().pose(),-sw, sh, 0.505f).color(1.f, 1.f, 1.f, 1.f).uv(0.f, 0.f).endVertex();
vb.draw();
tesselator.end();//Minecraft does shit with mah texture otherwise...
RenderSystem.bindTexture(0);
poseStack.popPose();