Interface Registerable.TrackingCollector

Enclosing interface:
Registerable

public static interface Registerable.TrackingCollector
Some helpful methods to track elements with names depending on this elements registry name.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    run(net.minecraftforge.registries.IForgeRegistry<T> registry, Consumer<T> action)
    Adds a registry tracking action with the same registry name as the current object.
    <T> void
    runNamed(net.minecraftforge.registries.IForgeRegistry<T> registry, String name, Consumer<T> action)
    Adds a registry tracking action with the same registry name as the current object with a given suffix.
    void
    track(net.minecraftforge.registries.IForgeRegistry<?> registry, Field field)
    Tracks a field with a value with the same registry name as the current object, registered in the given registry that is stored in the given field.
    void
    trackNamed(net.minecraftforge.registries.IForgeRegistry<?> registry, String name, Field field)
    Tracks a field with a value with the same registry name as the current object with a given suffix, registered in the given registry that is stored in the given field.
  • Method Details

    • track

      void track(net.minecraftforge.registries.IForgeRegistry<?> registry, Field field)
      Tracks a field with a value with the same registry name as the current object, registered in the given registry that is stored in the given field. The field must not be static and must be a field of the class that implements Registerable
    • trackNamed

      void trackNamed(net.minecraftforge.registries.IForgeRegistry<?> registry, String name, Field field)
      Tracks a field with a value with the same registry name as the current object with a given suffix, registered in the given registry that is stored in the given field. The field must not be static and must be a field of the class that implements Registerable
    • run

      <T> void run(net.minecraftforge.registries.IForgeRegistry<T> registry, Consumer<T> action)
      Adds a registry tracking action with the same registry name as the current object.
    • runNamed

      <T> void runNamed(net.minecraftforge.registries.IForgeRegistry<T> registry, String name, Consumer<T> action)
      Adds a registry tracking action with the same registry name as the current object with a given suffix.