Skip to content

Commit 5f21c24

Browse files
committed
Don't re-send crafting options for every storage change event
Related to CyclopsMC/IntegratedCrafting#156
1 parent 4533416 commit 5f21c24

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/org/cyclops/integratedterminals/core/terminalstorage/TerminalStorageTabIngredientComponentServer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public class TerminalStorageTabIngredientComponentServer<T, M> implements ITermi
8585
private final Int2ObjectMap<IIngredientCollapsedCollectionMutable<T, M>> unfilteredIngredientsViews;
8686
private final Int2ObjectMap<IngredientCollectionDiffManager<T, M>> filteredDiffManagers;
8787
private boolean initialized; // True if the first change event has been sent to the client.
88+
private boolean sentCraftingOptionsFiltered;
8889

8990
public TerminalStorageTabIngredientComponentServer(ResourceLocation name, INetwork network,
9091
IngredientComponent<T, M> ingredientComponent,
@@ -323,7 +324,10 @@ protected void reApplyFilter(@Nullable IIngredientComponentStorageObservable.Sto
323324
} else {
324325
channeledCraftingOptionsFiltered = channeledCraftingOptions;
325326
}
326-
this.sendCraftingOptionsToClient(channel, channeledCraftingOptionsFiltered, true, firstChannel);
327+
if (ingredientsFilter != null || this.sentCraftingOptionsFiltered) {
328+
this.sendCraftingOptionsToClient(channel, channeledCraftingOptionsFiltered, true, firstChannel);
329+
}
330+
this.sentCraftingOptionsFiltered = ingredientsFilter != null;
327331
}
328332

329333
firstChannel = false;

0 commit comments

Comments
 (0)