Class RegistryMonitorImpl<V>
java.lang.Object
org.quiltmc.qsl.frozenblock.core.registry.impl.event.RegistryMonitorImpl<V>
- Type Parameters:
V- the entry type of the monitoredRegistry
- All Implemented Interfaces:
RegistryMonitor<V>
The default implementation of
RegistryMonitor.
Modified to work on Fabric
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter(Predicate<RegistryEntryContext<V>> filter) A builder-like method to append a filter to the current registry monitor, for determining what entries to invoke registered callbacks for.voidforAll(RegistryEvents.EntryAdded<V> callback) Registers the specified callback to be invoked for every entry ever to be registered in the monitor's registry.voidforUpcoming(RegistryEvents.EntryAdded<V> callback) Registers the specified callback to be invoked for all future entries to registered in the monitor's registry.
-
Constructor Details
-
RegistryMonitorImpl
-
-
Method Details
-
filter
Description copied from interface:RegistryMonitorA builder-like method to append a filter to the current registry monitor, for determining what entries to invoke registered callbacks for.- Specified by:
filterin interfaceRegistryMonitor<V>- Parameters:
filter- a predicate which determines what entries to invoke callbacks for- Returns:
- the current registry monitor object, so as to allow chaining other methods in builder-like fashion
-
forAll
Description copied from interface:RegistryMonitorRegisters the specified callback to be invoked for every entry ever to be registered in the monitor's registry.Entries must also match the monitor's filters.
Registration to the registry being iterated must use the
RegistryEntryContext.register(ResourceLocation, Object)method inside the callback, or alternatively use theRegistryEntryContext.registry()method to get the registry instance, for example:context.register(id, block);.- Specified by:
forAllin interfaceRegistryMonitor<V>- Parameters:
callback- the callback to be invoked on entries
-
forUpcoming
Description copied from interface:RegistryMonitorRegisters the specified callback to be invoked for all future entries to registered in the monitor's registry.Entries must also match the monitor's filters.
- Specified by:
forUpcomingin interfaceRegistryMonitor<V>- Parameters:
callback- the callback to be invoked on entries
-