Package net.minestom.server.registry
Interface Holder<T>
- All Known Implementing Classes:
Holder.Direct,Holder.Reference
A
Holder is either a reference into a registry or a direct value which isnt necessarily registered with the client.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordA lazy holder allows for the value to be read as a reference without resolving it against the registry.static final record -
Method Summary
Modifier and TypeMethodDescriptioncodec(Registries.Selector<T> selector, @NotNull Codec<T> registryCodec) static <T> @NotNull Codec<Holder.Lazy<T>> lazyCodec(Registries.Selector<T> selector, @NotNull Codec<T> registryCodec) static <T> @NotNull NetworkBuffer.Type<Holder.Lazy<T>> lazyNetworkType(Registries.Selector<T> selector, NetworkBuffer.Type<T> registryNetworkType) static <T> @NotNull NetworkBuffer.Type<Holder<T>> networkType(Registries.Selector<T> selector, NetworkBuffer.Type<T> registryNetworkType) resolve(@NotNull DynamicRegistry<T> registry)
-
Method Details
-
resolve
-
networkType
static <T> @NotNull NetworkBuffer.Type<Holder<T>> networkType(@NotNull Registries.Selector<T> selector, @NotNull NetworkBuffer.Type<T> registryNetworkType) -
codec
@NotNull static <T> @NotNull Codec<Holder<T>> codec(@NotNull Registries.Selector<T> selector, @NotNull @NotNull Codec<T> registryCodec) -
lazyNetworkType
static <T> @NotNull NetworkBuffer.Type<Holder.Lazy<T>> lazyNetworkType(@NotNull Registries.Selector<T> selector, @NotNull NetworkBuffer.Type<T> registryNetworkType) -
lazyCodec
@NotNull static <T> @NotNull Codec<Holder.Lazy<T>> lazyCodec(@NotNull Registries.Selector<T> selector, @NotNull @NotNull Codec<T> registryCodec)
-