Interface RegistryEntryContext<V>

Type Parameters:
V - the entry type used by the relevant Registry

public interface RegistryEntryContext<V>
Represents information about a registry entry.

Underlying implementations may be mutable; do not store this object in your own fields directly.

  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.util.Identifier
    id()
    Returns the entry's namespaced identifier.
    int
    Returns the entry's raw int identifier.
    default <T extends V>
    T
    register(net.minecraft.util.Identifier id, T value)
    Safely registers a new entry in the registry of this context.
    net.minecraft.registry.Registry<V>
    Returns the relevant registry for this entry.
    Returns the entry's object.
  • Method Details

    • registry

      net.minecraft.registry.Registry<V> registry()
      Returns the relevant registry for this entry.
      Returns:
      the relevant registry for this entry
    • value

      V value()
      Returns the entry's object.
      Returns:
      the entry's object
    • id

      net.minecraft.util.Identifier id()
      Returns the entry's namespaced identifier.
      Returns:
      the entry's namespaced identifier
    • rawId

      int rawId()
      Returns the entry's raw int identifier.
      Returns:
      the entry's raw int identifier
    • register

      default <T extends V> T register(net.minecraft.util.Identifier id, T value)
      Safely registers a new entry in the registry of this context.

      Registration may be delayed when called from RegistryMonitor.forAll(RegistryEvents.EntryAdded).

      Type Parameters:
      T - the type of the value
      Parameters:
      id - the identifier of the entry
      value - the value to register
      Returns:
      the registered value