Skip to content

Commit

Permalink
Fix restarting jobs when resetting network, Closes #99
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Oct 10, 2023
1 parent 98f7307 commit c60145d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public PendingCraftingJobResultIndexObserver(IngredientComponent<T, M> ingredien

@Override
public void onChange(IIngredientComponentStorageObservable.StorageChangeEvent<T, M> event) {
if (event.getChangeType() == IIngredientComponentStorageObservable.Change.ADDITION) {
if (event.getChangeType() == IIngredientComponentStorageObservable.Change.ADDITION
// If we're still initializing the network, skip addition events.
// Otherwise, we could incorrectly mark running crafting jobs as finished.
&& !event.isInitialChange()) {
IIngredientCollection<T, M> addedIngredients = event.getInstances();
IIngredientComponentStorage<T, M> ingredientsHayStack = null; // A mutable copy of addedIngredients (lazily created)
IIngredientMatcher<T, M> matcher = ingredientComponent.getMatcher();
Expand Down

0 comments on commit c60145d

Please sign in to comment.