R - the final result as transformed by the functionA - the raw annotation itself can be transformedV - the valuepublic class AnnotatedRegistryLoader<R,A extends Annotation,V> extends Object implements RegistryLoader<String,Map<R,V>>
String and returns a transformed
Annotation as the value. The R represents the final result as mapped
by the A, the annotation. This function exists in this registry loader for
the purpose of annotations not often being used as a map key. The V generic
represents the actual map value of what is expected. The function transformation done
is used for transforming the key, however the value is not expected to be transformed.
Keep in mind that this annotation transforming does NOT need to be done, and can be
replaced with a simple Function.identity() if not desired.
See BlockEntityRegistryLoader and SoundHandlerRegistryLoader as a
good example of these registry loaders in use.
| Constructor and Description |
|---|
AnnotatedRegistryLoader(Class<A> annotation,
Function<A,R> mapper) |
| Modifier and Type | Method and Description |
|---|---|
Map<R,V> |
load(String input)
Loads an output from the given input.
|
Copyright © 2021 GeyserMC. All rights reserved.