Advertisement
Scouter456

Untitled

Jun 6th, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.45 KB | None | 0 0
  1.  
  2.     @Override
  3.     public void render(FruitLootBoxEntity tile, float partialTick, PoseStack matrix, MultiBufferSource buf, int packedLight) {
  4.         super.render(tile, partialTick, matrix, buf, packedLight);
  5.  
  6.         matrix.pushPose();
  7.         int color = 122331;
  8.         int r = color >> 16 & 255, g = color >> 8 & 255, b = color & 255;
  9.         RenderSystem.setShader(GameRenderer::getPositionTexShader);
  10.         RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
  11.         RenderSystem.setShaderTexture(0, this.getTextureLocation(tile));
  12.         VertexConsumer builder = buf.getBuffer(RenderType.entityCutout(getTextureLocation(tile)));
  13.  
  14.         builder.vertex(matrix.last().pose(), 0F, 0F, 0).color(r, g, b, 255).uv(1, 1).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(packedLight).normal(matrix.last().normal(), 0, 0, -1).endVertex();
  15.         builder.vertex(matrix.last().pose(), 0F, 1F, 0).color(r, g, b, 255).uv(1, 0).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(packedLight).normal(matrix.last().normal(), 0, 0, -1).endVertex();
  16.         builder.vertex(matrix.last().pose(), 1F, 1F, 0).color(r, g, b, 255).uv(0, 0).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(packedLight).normal(matrix.last().normal(), 0, 0, -1).endVertex();
  17.         builder.vertex(matrix.last().pose(), 1F, 0F, 0).color(r, g, b, 255).uv(0, 1).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(packedLight).normal(matrix.last().normal(), 0, 0, -1).endVertex();
  18.  
  19.  
  20.         matrix.popPose();
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement