Interface WyckRegistry

All Superinterfaces:
Wrapper

@NullMarked @AsOf("2.3.0") @Internal public interface WyckRegistry extends Wrapper
A minimal abstraction of Minecraft's registry with frozen registry utilities.
Since:
2.3.0
  • Field Details

  • Method Details

    • key

      @AsOf("2.3.0") ResourceKey key()
      The key of the registry.
      Returns:
      the key of the registry
    • registry

      @AsOf("2.3.0") Object registry()
      The registry itself.
      Returns:
      the registry itself
      Since:
      2.3.0
    • isFrozen

      @AsOf("2.3.0") boolean isFrozen()
      Whether the registry is frozen.
      Returns:
      whether the registry is frozen
    • unFreeze

      @AsOf("2.3.0") void unFreeze()
      Unfreezes the registry.
      Since:
      2.3.0
    • freeze

      @AsOf("2.3.0") void freeze()
      Unbinds all tags and freezes the registry.
      Since:
      2.3.0
    • whileUnfrozen

      @AsOf("2.3.0") void whileUnfrozen(Runnable action)
      Runs the given action while the registry is unfrozen.
      Parameters:
      action - the action to run
      Since:
      2.3.0
    • retrieve

      @AsOf("3.0.0") <T> @Nullable T retrieve(ResourceKey key)
      Retrieves an object from the registry.
      Type Parameters:
      T - the type of the object
      Parameters:
      key - the key of the object to retrieve
      Returns:
      the object
      Since:
      3.0.0
    • whileUnfrozen

      @AsOf("2.4.0") default void whileUnfrozen(Consumer<WyckRegistry> consumer)
      Runs the given consumer with the registry while it is unfrozen.
      Parameters:
      consumer - the consumer to run
      Since:
      2.4.0
    • toMinecraft

      @AsOf("2.3.0") default Object toMinecraft()
      Returns the registry itself.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      the registry itself
      Since:
      2.3.0
    • of

      @AsOf("2.3.0") static WyckRegistry of(ResourceKey key)
      Creates a FrozenRegistry from a ResourceKey.
      Parameters:
      key - the key of the registry
      Returns:
      a FrozenRegistry instance
      Since:
      2.3.0
    • of

      @AsOf("2.3.0") static WyckRegistry of(String path)
      Creates a FrozenRegistry from a Minecraft registry path.
      Parameters:
      path - the path of the registry
      Returns:
      a FrozenRegistry instance
      Since:
      2.3.0
    • of

      @AsOf("2.4.0") static WyckRegistry of(RegistryId reference)
      Creates a FrozenRegistry from a RegistryReference.
      Parameters:
      reference - the registry reference
      Returns:
      a FrozenRegistry instance
      Since:
      2.4.0
    • lazy

      @AsOf("2.3.0") static Lazy<WyckRegistry> lazy(ResourceKey key)
      Creates a lazy FrozenRegistry.
      Parameters:
      key - the key of the registry
      Returns:
      a lazy FrozenRegistry instance
      Since:
      2.3.0
    • lazy

      @AsOf("2.3.0") static Lazy<WyckRegistry> lazy(String path)
      Creates a lazy FrozenRegistry.
      Parameters:
      path - the path of the registry
      Returns:
      a lazy FrozenRegistry instance
      Since:
      2.3.0
    • lazy

      @AsOf("2.4.0") static Lazy<WyckRegistry> lazy(RegistryId reference)
      Creates a lazy FrozenRegistry.
      Parameters:
      reference - the registry reference
      Returns:
      a lazy FrozenRegistry instance
      Since:
      2.4.0