1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-12 10:20:28 +00:00

Fix monitor clear state being cleared without a redraw

This commit is contained in:
SquidDev 2018-02-21 14:32:53 +00:00
parent d3ecd5214b
commit 15a3882016
2 changed files with 6 additions and 7 deletions

View File

@ -92,7 +92,7 @@ public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer<TileMon
BufferBuilder renderer = tessellator.getBuffer();
// Get terminal
boolean redraw = originTerminal.hasTerminalChanged();
boolean redraw = originTerminal.pollTerminalChanged();
// Draw the contents
GlStateManager.depthMask( false );

View File

@ -14,29 +14,28 @@ public class ClientTerminal implements ITerminal
private boolean m_colour;
private Terminal m_terminal;
private boolean m_terminalChanged;
private boolean m_terminalChangedLastFrame;
public ClientTerminal( boolean colour )
{
m_colour = colour;
m_terminal = null;
m_terminalChanged = false;
m_terminalChangedLastFrame = false;
}
public void update()
{
m_terminalChangedLastFrame = m_terminalChanged || (m_terminal != null && m_terminal.getChanged());
if( m_terminal != null )
{
m_terminalChanged |= m_terminal.getChanged();
m_terminal.clearChanged();
}
m_terminalChanged = false;
}
public boolean hasTerminalChanged()
public boolean pollTerminalChanged()
{
return m_terminalChangedLastFrame;
boolean changed = m_terminalChanged;
m_terminalChanged = false;
return changed;
}
// ITerminal implementation