Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void render(FruitLootBoxEntity tile, float partialTick, PoseStack matrix, MultiBufferSource buf, int packedLight) {
- super.render(tile, partialTick, matrix, buf, packedLight);
- matrix.pushPose();
- int color = 122331;
- int r = color >> 16 & 255, g = color >> 8 & 255, b = color & 255;
- RenderSystem.setShader(GameRenderer::getPositionTexShader);
- RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
- RenderSystem.setShaderTexture(0, this.getTextureLocation(tile));
- VertexConsumer builder = buf.getBuffer(RenderType.entityCutout(getTextureLocation(tile)));
- 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();
- 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();
- 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();
- 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();
- matrix.popPose();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement