Class RegistryMonitorImpl<V>

java.lang.Object
org.quiltmc.qsl.frozenblock.core.registry.impl.event.RegistryMonitorImpl<V>
Type Parameters:
V - the entry type of the monitored Registry
All Implemented Interfaces:
RegistryMonitor<V>

@Internal public class RegistryMonitorImpl<V> extends Object implements RegistryMonitor<V>
The default implementation of RegistryMonitor.

Modified to work on Fabric

  • Constructor Details

    • RegistryMonitorImpl

      public RegistryMonitorImpl(net.minecraft.core.Registry<V> registry)
  • Method Details

    • filter

      public RegistryMonitor<V> filter(Predicate<RegistryEntryContext<V>> filter)
      Description copied from interface: RegistryMonitor
      A builder-like method to append a filter to the current registry monitor, for determining what entries to invoke registered callbacks for.
      Specified by:
      filter in interface RegistryMonitor<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

      public void forAll(RegistryEvents.EntryAdded<V> callback)
      Description copied from interface: RegistryMonitor
      Registers 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 the RegistryEntryContext.registry() method to get the registry instance, for example: context.register(id, block);.

      Specified by:
      forAll in interface RegistryMonitor<V>
      Parameters:
      callback - the callback to be invoked on entries
    • forUpcoming

      public void forUpcoming(RegistryEvents.EntryAdded<V> callback)
      Description copied from interface: RegistryMonitor
      Registers 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:
      forUpcoming in interface RegistryMonitor<V>
      Parameters:
      callback - the callback to be invoked on entries