mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-26 14:25:20 +00:00
NetworkMonitor optimization - do not rebuild cache more than once per tick
This commit is contained in:
1 parent
01729e79a0
commit
09b253109c
1 file changed
+4
-1
+4
-1
@@ -56,6 +56,7 @@ public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
||||
|
||||
private boolean sendEvent = false;
|
||||
private boolean hasChanged = false;
|
||||
private boolean ticked = true;
|
||||
@Nonnegative
|
||||
private int localDepthSemaphore = 0;
|
||||
|
||||
@@ -133,9 +134,10 @@ public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
||||
@Override
|
||||
public IItemList<T> getStorageList()
|
||||
{
|
||||
if( this.hasChanged )
|
||||
if( hasChanged && ticked )
|
||||
{
|
||||
this.hasChanged = false;
|
||||
ticked = false;
|
||||
this.cachedList.resetStatus();
|
||||
return this.getAvailableItems( this.cachedList );
|
||||
}
|
||||
@@ -329,6 +331,7 @@ public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
||||
|
||||
void onTick()
|
||||
{
|
||||
ticked = true;
|
||||
if( this.sendEvent )
|
||||
{
|
||||
this.sendEvent = false;
|
||||
|
||||
Reference in new issue
Block a user