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:
parent
d3ecd5214b
commit
15a3882016
@ -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 );
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user