fix for infinite loop while loading

This commit is contained in:
PrototypeTrousers
2022-01-24 13:19:31 -03:00
parent 63e339b88b
commit d7f3428824
3 changed files with 10 additions and 5 deletions
@@ -417,8 +417,6 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
// :P
}
}
this.notifyNeighbors();
}
private void updateCraftingList()
+7 -1
View File
@@ -68,6 +68,7 @@ public class GridStorageCache implements IStorageGrid
private final HashMap<IGridNode, IStackWatcher> watchers = new HashMap<>();
private final Map<IStorageChannel<? extends IAEStack>, NetworkInventoryHandler<?>> storageNetworks;
private final Map<IStorageChannel<? extends IAEStack>, NetworkMonitor<?>> storageMonitors;
private int localDepth;
public GridStorageCache( final IGrid g )
{
@@ -212,6 +213,11 @@ public class GridStorageCache implements IStorageGrid
@MENetworkEventSubscribe
public void cellUpdate( final MENetworkCellArrayUpdate ev )
{
if( localDepth > 0 )
{
return;
}
localDepth++;
this.storageNetworks.clear();
final List<ICellProvider> ll = new ArrayList<ICellProvider>();
@@ -247,7 +253,7 @@ public class GridStorageCache implements IStorageGrid
}
}
tracker.applyChanges();
localDepth--;
this.storageMonitors.forEach( ( channel, monitor ) -> monitor.setForceUpdate( true ) );
}
@@ -119,14 +119,15 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
if( this.getTileEntity() != null && this.eventsEnabled() && !this.dirtyFlag )
{
this.dirtyFlag = true;
ItemStack newStack = this.getStackInSlot( slot ).copy();
ItemStack newStack = this.getStackInSlot( slot );
ItemStack oldStack = this.previousStack;
InvOperation op = InvOperation.SET;
if( newStack.isEmpty() || oldStack.isEmpty() || ( oldStack.getCount() < oldStack.getMaxStackSize() && oldStack.getCount() < this.getSlotLimit( slot ) && ItemStack.areItemsEqual( newStack, oldStack ) ) )
if( newStack.isEmpty() || oldStack.isEmpty() || oldStack.getCount() != newStack.getCount() && ItemStack.areItemsEqual( newStack, oldStack ) )
{
if( newStack.getCount() > oldStack.getCount() )
{
newStack = newStack.copy();
newStack.shrink( oldStack.getCount() );
oldStack = ItemStack.EMPTY;
op = InvOperation.INSERT;