From feda08b9154ee828acc4aaee16b6c327fb0b9197 Mon Sep 17 00:00:00 2001 From: Merith-TK Date: Mon, 22 Feb 2021 17:43:54 -0800 Subject: [PATCH] Draw in-hand pocket computers with blending --- patchwork.md | 10 ++++++++++ .../client/render/ItemPocketRenderer.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/patchwork.md b/patchwork.md index 631a6cf8f..04a7fec16 100644 --- a/patchwork.md +++ b/patchwork.md @@ -234,3 +234,13 @@ Bump cct-javadoc version Documentation will now be sorted (somewhat) correctly! ``` + +``` +a6fcfb6af2fc1bef8ca3a19122c9267549202424 +Draw in-hand pocket computers with blending + +It might be worth switching to RenderTypes here, rather than a pure +Tesselator, but this'll do for now. + +Fixes Zundrel/cc-tweaked-fabric#20. +``` diff --git a/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java b/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java index 7d77764b5..85d74e169 100644 --- a/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java @@ -95,6 +95,7 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer { } private static void renderFrame(Matrix4f transform, ComputerFamily family, int colour, int width, int height) { + RenderSystem.enableBlend(); MinecraftClient.getInstance() .getTextureManager() .bindTexture(colour != -1 ? ComputerBorderRenderer.BACKGROUND_COLOUR : ComputerBorderRenderer.getTexture(family)); @@ -113,7 +114,6 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer { } private static void renderLight(Matrix4f transform, int colour, int width, int height) { - RenderSystem.enableBlend(); RenderSystem.disableTexture(); float r = ((colour >>> 16) & 0xFF) / 255.0f;