Interface RegistryHasher<DirectType>

Type Parameters:
DirectType - the type this hasher hashes. Only used for registry hashers that can hash holders.
All Superinterfaces:
MinecraftHasher<Integer>
All Known Implementing Classes:
RegistryHasher.RegistryHasherWithDirectHasher

public interface RegistryHasher<DirectType> extends MinecraftHasher<Integer>
RegistryHashers are hashers that hash a network integer ID to a namespaced identifier. RegistryHashers can be created using static utility methods in this class, and all registry hashers should be kept in here.

The DirectType parameter is only used for registry hashers that are able to encode Holders, and must be left as a ? if this functionality is not in use. This makes it clear the hasher is not supposed to be able to encode holders.

To create a hasher that can encode a Holder, a direct hasher should be created that hashes a DirectType (in case of a custom holder), and registry(Registry, MinecraftHasher) should be used to create the registry hasher. holder() can then be used to obtain a hasher that encodes a holder of DirectType.

Along with RegistryHashers, this class also contains a bunch of hashers for various Minecraft objects. For organisational purposes, these are grouped in various sections with comments.