mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-29 21:02:59 +00:00 
			
		
		
		
	Minor fixes to the monitor rewrite
This commit is contained in:
		| @@ -41,7 +41,7 @@ public class TileMonitor extends TilePeripheralBase | |||||||
|     // Members |     // Members | ||||||
|     private ServerMonitor m_serverMonitor; |     private ServerMonitor m_serverMonitor; | ||||||
|     private ClientMonitor m_clientMonitor; |     private ClientMonitor m_clientMonitor; | ||||||
|     private boolean hasPeripheral; |     private MonitorPeripheral m_peripheral; | ||||||
|     private final Set<IComputerAccess> m_computers; |     private final Set<IComputerAccess> m_computers; | ||||||
|  |  | ||||||
|     private boolean m_destroyed; |     private boolean m_destroyed; | ||||||
| @@ -190,9 +190,10 @@ public class TileMonitor extends TilePeripheralBase | |||||||
|     @Override |     @Override | ||||||
|     public IPeripheral getPeripheral( EnumFacing side ) |     public IPeripheral getPeripheral( EnumFacing side ) | ||||||
|     { |     { | ||||||
|         hasPeripheral = true; |  | ||||||
|         createServerMonitor(); // Ensure the monitor is created before doing anything else. |         createServerMonitor(); // Ensure the monitor is created before doing anything else. | ||||||
|         return new MonitorPeripheral( this ); |  | ||||||
|  |         if( m_peripheral == null ) m_peripheral = new MonitorPeripheral( this ); | ||||||
|  |         return m_peripheral; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public ServerMonitor getCachedServerMonitor() |     public ServerMonitor getCachedServerMonitor() | ||||||
| @@ -315,7 +316,6 @@ public class TileMonitor extends TilePeripheralBase | |||||||
|             updateBlock(); |             updateBlock(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     // Sizing and placement stuff |     // Sizing and placement stuff | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -447,6 +447,9 @@ public class TileMonitor extends TilePeripheralBase | |||||||
|  |  | ||||||
|     private void resize( int width, int height ) |     private void resize( int width, int height ) | ||||||
|     { |     { | ||||||
|  |         // If we're not already the origin then we'll need to generate a new terminal. | ||||||
|  |         if(m_xIndex != 0 || m_yIndex != 0) m_serverMonitor = null; | ||||||
|  |  | ||||||
|         m_xIndex = 0; |         m_xIndex = 0; | ||||||
|         m_yIndex = 0; |         m_yIndex = 0; | ||||||
|         m_width = width; |         m_width = width; | ||||||
| @@ -462,7 +465,7 @@ public class TileMonitor extends TilePeripheralBase | |||||||
|             for( int y = 0; y < height; y++ ) |             for( int y = 0; y < height; y++ ) | ||||||
|             { |             { | ||||||
|                 TileMonitor monitor = getNeighbour( x, y ); |                 TileMonitor monitor = getNeighbour( x, y ); | ||||||
|                 if( monitor != null && monitor.hasPeripheral ) |                 if( monitor != null && monitor.m_peripheral != null ) | ||||||
|                 { |                 { | ||||||
|                     needsTerminal = true; |                     needsTerminal = true; | ||||||
|                     break terminalCheck; |                     break terminalCheck; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev