Skip to content

Commit 67018b8

Browse files
authored
fix: Screen render distance
1 parent 8f4f575 commit 67018b8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/dev/hephaestus/glowcase/client/render/block/entity/ScreenBlockEntityRenderer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import net.minecraft.text.Text;
1818
import net.minecraft.util.Identifier;
1919
import net.minecraft.util.math.RotationAxis;
20+
import net.minecraft.util.math.Vec3d;
2021
import org.jetbrains.annotations.NotNull;
2122
import org.jetbrains.annotations.Nullable;
2223
import org.joml.Matrix4f;
@@ -168,7 +169,7 @@ public static void renderErrCode(int code, ScreenBlockEntity entity, float width
168169
float txt_width = width * 0.95f;
169170
float txt_gap = width * 0.05f;
170171

171-
matrices.translate(txt_width/2f - (txt_gap/2f), height/2f - (lineHeight/2f), -.01f); // Upper-Left corner
172+
matrices.translate(txt_width/2f - (txt_gap/2f), height/2f - (lineHeight/2f), -.1f); // Upper-Left corner
172173
matrices.scale(-font_scale, -font_scale, -.1f);
173174

174175
// Alt-Text
@@ -242,7 +243,7 @@ private void renderTextCentered(String text, int color, float scr_width, float s
242243

243244
// Apply
244245
matrices.scale(-font_scale_factor, -font_scale_factor, -0.1f);
245-
matrices.translate(-textRenderer.getWidth(text)/2f, -textRenderer.fontHeight/2f, .05f); // Remove offset of string
246+
matrices.translate(-textRenderer.getWidth(text)/2f, -textRenderer.fontHeight/2f, -.1f); // Remove offset of string
246247

247248
textRenderer.draw(text, 0, 0, color, true, matrices.peek().getPositionMatrix(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, light);
248249
}
@@ -303,4 +304,9 @@ private static void renderFilledRectangle(int color, float x1, float x2, float y
303304
public boolean rendersOutsideBoundingBox(ScreenBlockEntity blockEntity) {
304305
return true;
305306
}
307+
308+
@Override
309+
public boolean isInRenderDistance(ScreenBlockEntity blockEntity, Vec3d pos) {
310+
return true;
311+
}
306312
}

0 commit comments

Comments
 (0)