From c3fd2552ed37de09f214359354f626cd71311552 Mon Sep 17 00:00:00 2001 From: IchHabeHunger54 Date: Thu, 19 Dec 2024 22:59:06 +0100 Subject: [PATCH] try fixing clipboard depth rendering (introduces new bugs) --- .../bibliocraft/client/ClipboardReadOnlyRenderer.java | 3 +++ .../bibliocraft/client/ber/ClipboardBER.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ClipboardReadOnlyRenderer.java b/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ClipboardReadOnlyRenderer.java index a16fbd1f..b9498511 100644 --- a/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ClipboardReadOnlyRenderer.java +++ b/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ClipboardReadOnlyRenderer.java @@ -29,7 +29,9 @@ public final class ClipboardReadOnlyRenderer { private static final ResourceLocation X_TEXTURE = BCUtil.modLoc("x"); public static void render(PoseStack pose, MultiBufferSource bufferSource, ClipboardContent data, int width, int height) { + pose.pushPose(); blit(pose, BACKGROUND, 0, 0, 0, 0, width, height, 256, 256); + pose.translate(0, 0, -0.01); drawText(pose, bufferSource, data.title(), 29, 2, 72, 8); ClipboardContent.Page page = data.pages().get(data.active()); for (int i = 0; i < ClipboardContent.MAX_LINES; i++) { @@ -41,6 +43,7 @@ public static void render(PoseStack pose, MultiBufferSource bufferSource, Clipbo } drawText(pose, bufferSource, page.lines().get(i), 17, 15 * i + 16, 109, 8); } + pose.popPose(); } private static void drawText(PoseStack pose, MultiBufferSource bufferSource, String text, float x, float y, int width, int height) { diff --git a/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ber/ClipboardBER.java b/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ber/ClipboardBER.java index 67154dfd..c4979177 100644 --- a/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ber/ClipboardBER.java +++ b/src/main/java/com/github/minecraftschurlimods/bibliocraft/client/ber/ClipboardBER.java @@ -3,6 +3,7 @@ import com.github.minecraftschurlimods.bibliocraft.client.ClipboardReadOnlyRenderer; import com.github.minecraftschurlimods.bibliocraft.content.clipboard.ClipboardBlockEntity; import com.github.minecraftschurlimods.bibliocraft.util.ClientUtil; +import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; import net.minecraft.client.renderer.MultiBufferSource; @@ -11,6 +12,7 @@ public class ClipboardBER implements BlockEntityRenderer { @Override public void render(ClipboardBlockEntity blockEntity, float partialTick, PoseStack stack, MultiBufferSource buffer, int light, int overlay) { + RenderSystem.enableDepthTest(); stack.pushPose(); ClientUtil.setupCenteredBER(stack, blockEntity); stack.mulPose(Axis.XP.rotationDegrees(180)); @@ -20,5 +22,6 @@ public void render(ClipboardBlockEntity blockEntity, float partialTick, PoseStac stack.scale(scale, scale, 0); ClipboardReadOnlyRenderer.render(stack, buffer, blockEntity.getContent(), 128, 148); stack.popPose(); + RenderSystem.disableDepthTest(); } }