Interface WyckRegistry
- All Superinterfaces:
Wrapper
A minimal abstraction of Minecraft's registry with frozen registry utilities.
- Since:
- 2.3.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Wrapper
Wrapper.Context<C> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeze()Unbinds all tags and freezes the registry.booleanisFrozen()Whether the registry is frozen.key()The key of the registry.static Lazy<WyckRegistry> lazy(ResourceKey key) Creates a lazy FrozenRegistry.static Lazy<WyckRegistry> lazy(RegistryId reference) Creates a lazy FrozenRegistry.static Lazy<WyckRegistry> Creates a lazy FrozenRegistry.static WyckRegistryof(ResourceKey key) Creates a FrozenRegistry from a ResourceKey.static WyckRegistryof(RegistryId reference) Creates a FrozenRegistry from a RegistryReference.static WyckRegistryCreates a FrozenRegistry from a Minecraft registry path.registry()The registry itself.<T> @Nullable Tretrieve(ResourceKey key) Retrieves an object from the registry.default ObjectReturns the registry itself.voidunFreeze()Unfreezes the registry.voidwhileUnfrozen(Runnable action) Runs the given action while the registry is unfrozen.default voidwhileUnfrozen(Consumer<WyckRegistry> consumer) Runs the given consumer with the registry while it is unfrozen.
-
Field Details
-
WIRE
-
-
Method Details
-
key
-
registry
-
isFrozen
Whether the registry is frozen.- Returns:
- whether the registry is frozen
-
unFreeze
-
freeze
-
whileUnfrozen
-
retrieve
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
Runs the given consumer with the registry while it is unfrozen.- Parameters:
consumer- the consumer to run- Since:
- 2.4.0
-
toMinecraft
Returns the registry itself.- Specified by:
toMinecraftin interfaceWrapper- Returns:
- the registry itself
- Since:
- 2.3.0
-
of
Creates a FrozenRegistry from a ResourceKey.- Parameters:
key- the key of the registry- Returns:
- a FrozenRegistry instance
- Since:
- 2.3.0
-
of
Creates a FrozenRegistry from a Minecraft registry path.- Parameters:
path- the path of the registry- Returns:
- a FrozenRegistry instance
- Since:
- 2.3.0
-
of
Creates a FrozenRegistry from a RegistryReference.- Parameters:
reference- the registry reference- Returns:
- a FrozenRegistry instance
- Since:
- 2.4.0
-
lazy
Creates a lazy FrozenRegistry.- Parameters:
key- the key of the registry- Returns:
- a lazy FrozenRegistry instance
- Since:
- 2.3.0
-
lazy
Creates a lazy FrozenRegistry.- Parameters:
path- the path of the registry- Returns:
- a lazy FrozenRegistry instance
- Since:
- 2.3.0
-
lazy
Creates a lazy FrozenRegistry.- Parameters:
reference- the registry reference- Returns:
- a lazy FrozenRegistry instance
- Since:
- 2.4.0
-