namespaceCodec

open override fun <T> namespaceCodec(registry: Registry<T>): Codec<T>

Creates a registry value codec that allows for identifier shortcutting based on the namespace used to build this builder. Vanilla will shorten ids for the minecraft namespace (minecraft:thing to thing). This does the same thing but for the namespace provided.

This is useful for creating more concise data formats with many registered "keys" without having to resort to registering those keys to the MC namespace.

Return

Codec for values of T that will shorten output strings if the id namepace is the one you built this builder with

Author

fzzyhmstrs

Since

0.7.4

Parameters

T

type of object stored in the registry

registry

Registry Registry to build the codec off of.