Interface ItemChangeFilter
- All Known Subinterfaces:
RecordingItemChangeFilter
- All Known Implementing Classes:
BasicItemChangeFilter,RecordingItemChangeFilter.EmptyFilter,SingleItemChangeFilter
@PublicSpi
public interface ItemChangeFilter
An implementor of this interfaces checks if any of changed items may affect a built forest fragment.
The implementor may detect only changes those are recorded to ItemTracker
Here is the basic implementation:
return itemIds.stream().anyMatch(itemId ->
// return true if a change of the item may affect the forest fragment
);
If the forest fragment may depend on changes those are not reported to the ItemTracker
You have to implement UpdateChecker
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(Set<ItemIdentity> itemIds, StructureGenerator.ItemChangeFilterContext context) Checks if any of changed items may affect the built forest.
-
Method Details
-
accept
boolean accept(@NotNull Set<ItemIdentity> itemIds, @NotNull StructureGenerator.ItemChangeFilterContext context) Checks if any of changed items may affect the built forest.- Parameters:
itemIds- set of changed itemscontext- convenient methods to check an item- Returns:
- true if the forest fragment may be stale, Structure has to regenerate the forest. false if none of the changed item affects the fragment.
-