Interface RegisteredConstantTranslator<W>
Translates wrapper constants to and from the entries of a Minecraft registry,
the registry counterpart to
KeyedEnumTranslator.- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescription<N> WfromNms(N nmsConstant) static <W> RegisteredConstantTranslator<W> of(RegistryId registry, Function<W, ResourceKey> keyExtractor, W[] values) static <W> RegisteredConstantTranslator<W> of(Lazy<WyckRegistry> passedRegistry, Function<W, ResourceKey> keyExtractor, W[] values) Translator that resolves a wrapper against the given registry by the key extracted from it and inverts through a lazily built identity map from the resolved registry value back to the wrapper.static <W> RegisteredConstantTranslator<W> of(String name, Function<W, ResourceKey> keyExtractor, W[] values) <N> N
-
Method Details
-
toNms
-
fromNms
-
of
@AsOf("3.0.0") static <W> RegisteredConstantTranslator<W> of(String name, Function<W, ResourceKey> keyExtractor, W[] values) -
of
@AsOf("3.0.0") static <W> RegisteredConstantTranslator<W> of(RegistryId registry, Function<W, ResourceKey> keyExtractor, W[] values) -
of
@AsOf("3.0.0") @Contract(value="_, _, _ -> new", pure=true) static <W> RegisteredConstantTranslator<W> of(Lazy<WyckRegistry> passedRegistry, Function<W, ResourceKey> keyExtractor, W[] values) Translator that resolves a wrapper against the given registry by the key extracted from it and inverts through a lazily built identity map from the resolved registry value back to the wrapper.- Parameters:
passedRegistry- the registry to resolve againstkeyExtractor- extracts the registry key from a wrapper instancevalues- all values of the wrapper enum- Since:
- 3.0.0
-