diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index fa7c0a8f1..d59206009 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -77,10 +77,6 @@ public final class ComputerCraftProxyClient implements ClientModInitializer BlockRenderLayerMap.INSTANCE.putBlock( ComputerCraftRegistry.ModBlocks.TURTLE_NORMAL, RenderLayer.getTranslucent() ); BlockRenderLayerMap.INSTANCE.putBlock( ComputerCraftRegistry.ModBlocks.TURTLE_ADVANCED, RenderLayer.getTranslucent() ); - // Monitors' textures have transparent fronts and so count as cutouts. - BlockRenderLayerMap.INSTANCE.putBlock( ComputerCraftRegistry.ModBlocks.MONITOR_NORMAL, RenderLayer.getCutout() ); - BlockRenderLayerMap.INSTANCE.putBlock( ComputerCraftRegistry.ModBlocks.MONITOR_ADVANCED, RenderLayer.getCutout() ); - // Setup TESRs BlockEntityRendererRegistry.INSTANCE.register( ComputerCraftRegistry.ModTiles.MONITOR_NORMAL, TileEntityMonitorRenderer::new ); BlockEntityRendererRegistry.INSTANCE.register( ComputerCraftRegistry.ModTiles.MONITOR_ADVANCED, TileEntityMonitorRenderer::new ); diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java index 5390b812a..3e797aa7b 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java @@ -59,10 +59,7 @@ public class TileEntityMonitorRenderer extends BlockEntityRenderer // Render from the origin monitor ClientMonitor originTerminal = monitor.getClientMonitor(); - if( originTerminal == null ) - { - return; - } + if( originTerminal == null ) return; TileMonitor origin = originTerminal.getOrigin(); BlockPos monitorPos = monitor.getPos(); @@ -96,7 +93,7 @@ public class TileEntityMonitorRenderer extends BlockEntityRenderer transform.multiply( Vector3f.POSITIVE_X.getDegreesQuaternion( pitch ) ); transform.translate( -0.5 + TileMonitor.RENDER_BORDER + TileMonitor.RENDER_MARGIN, origin.getHeight() - 0.5 - (TileMonitor.RENDER_BORDER + TileMonitor.RENDER_MARGIN) + 0, - 0.5 ); + 0.501 ); double xSize = origin.getWidth() - 2.0 * (TileMonitor.RENDER_MARGIN + TileMonitor.RENDER_BORDER); double ySize = origin.getHeight() - 2.0 * (TileMonitor.RENDER_MARGIN + TileMonitor.RENDER_BORDER); @@ -112,8 +109,7 @@ public class TileEntityMonitorRenderer extends BlockEntityRenderer transform.push(); transform.scale( (float) xScale, (float) -yScale, 1.0f ); - Matrix4f matrix = transform.peek() - .getModel(); + Matrix4f matrix = transform.peek().getModel(); // Sneaky hack here: we get a buffer now in order to flush existing ones and set up the appropriate // render state. I've no clue how well this'll work in future versions of Minecraft, but it does the trick @@ -127,6 +123,8 @@ public class TileEntityMonitorRenderer extends BlockEntityRenderer // reasonable. FixedWidthFontRenderer.drawCursor( matrix, buffer, 0, 0, terminal, !originTerminal.isColour() ); + FixedWidthFontRenderer.TYPE.endDrawing(); + transform.pop(); } else @@ -140,13 +138,12 @@ public class TileEntityMonitorRenderer extends BlockEntityRenderer (float) -(ySize + MARGIN * 2) ); } - FixedWidthFontRenderer.drawBlocker( transform.peek() - .getModel(), - renderer, - (float) -TileMonitor.RENDER_MARGIN, - (float) TileMonitor.RENDER_MARGIN, - (float) (xSize + 2 * TileMonitor.RENDER_MARGIN), - (float) -(ySize + TileMonitor.RENDER_MARGIN * 2) ); +// FixedWidthFontRenderer.drawBlocker( transform.peek().getModel(), +// renderer, +// (float) -TileMonitor.RENDER_MARGIN, +// (float) TileMonitor.RENDER_MARGIN, +// (float) (xSize + 2 * TileMonitor.RENDER_MARGIN), +// (float) -(ySize + TileMonitor.RENDER_MARGIN * 2) ); transform.pop(); }