V - the valuepublic class VersionedRegistry<V> extends AbstractMappedRegistry<Integer,V,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>>
SimpleMappedRegistry, the Map interface is
not able to be specified here, but unlike it, it does not have support for specialized
instances, and ONLY supports Int2ObjectMap for optimal performance to prevent boxing
of integers.| Modifier | Constructor and Description |
|---|---|
protected |
VersionedRegistry(I input,
RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader) |
| Modifier and Type | Method and Description |
|---|---|
static <I,V> VersionedRegistry<V> |
create(I input,
RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader)
Creates a new versioned registry with the given
RegistryLoader and input. |
static <I,V> VersionedRegistry<V> |
create(I input,
Supplier<RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>>> registryLoader)
Creates a new versioned registry with the given
RegistryLoader supplier and input. |
static <I,V> VersionedRegistry<V> |
create(RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader)
Creates a new versioned registry with the given
RegistryLoader. |
static <I,V> VersionedRegistry<V> |
create(Supplier<RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>>> registryLoader)
Creates a new versioned registry with the given
RegistryLoader supplier. |
V |
forVersion(int version)
Gets the closest value for the specified version.
|
get, getOrDefault, registerprotected VersionedRegistry(I input,
RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader)
public V forVersion(int version)
version - the versionpublic static <I,V> VersionedRegistry<V> create(RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader)
RegistryLoader. The
input type is not specified here, meaning the loader return type is either
predefined, or the registry is populated at a later point.I - the inputV - the map valueregistryLoader - the registry loaderpublic static <I,V> VersionedRegistry<V> create(I input, RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>> registryLoader)
RegistryLoader and input.I - the inputV - the map valueregistryLoader - the registry loaderpublic static <I,V> VersionedRegistry<V> create(Supplier<RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>>> registryLoader)
RegistryLoader supplier.
The input type is not specified here, meaning the loader return type is either
predefined, or the registry is populated at a later point.I - the inputV - the map valueregistryLoader - the registry loaderpublic static <I,V> VersionedRegistry<V> create(I input, Supplier<RegistryLoader<I,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>>> registryLoader)
RegistryLoader supplier and input.I - the inputV - the map valueregistryLoader - the registry loaderCopyright © 2021 GeyserMC. All rights reserved.