Contents
Class MetaRegistry<K>
java.lang.Object
com.hypixel.hytale.server.core.meta.MetaRegistry<K>
- All Implemented Interfaces:
IMetaRegistry<K>
-
Nested Class Summary
Nested classes/interfaces inherited from interface IMetaRegistry
IMetaRegistry.MetaEntryConsumer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachMetaEntry(IMetaStore<K> store, IMetaRegistry.MetaEntryConsumer consumer) getMetaKeyForCodecKey(String codecKey) <T> TnewMetaObject(MetaKey<T> key, K parent) Returns a new instance of the associated meta object which is created from the Supplier passed in the register method.<T> MetaKey<T> registerMetaObject(Function<K, T> function, boolean persistent, String keyName, Codec<T> codec) This is used to create a new meta object and returns the integer id to lookup the objectMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IMetaRegistry
registerMetaObject, registerMetaObject, registerMetaObject
-
Constructor Details
-
MetaRegistry
public MetaRegistry()
-
-
Method Details
-
registerMetaObject
public <T> MetaKey<T> registerMetaObject(Function<K, T> function, boolean persistent, String keyName, @Nonnull Codec<T> codec) Description copied from interface:IMetaRegistryThis is used to create a new meta object and returns the integer id to lookup the object- Specified by:
registerMetaObjectin interfaceIMetaRegistry<K>- Parameters:
function- Supplier used to create a new object when a world has no instancepersistent- True if meta value is persistentkeyName- Key name of this codeccodec- Codec to encode this type. Generally a KeyedCodec- Returns:
- MetaKey to lookup the meta object
-
newMetaObject
Description copied from interface:IMetaRegistryReturns a new instance of the associated meta object which is created from the Supplier passed in the register method.- Specified by:
newMetaObjectin interfaceIMetaRegistry<K>- Type Parameters:
T- Type of the returned object- Parameters:
key- Metakey from #register(Supplier).- Returns:
- New instance of Meta object
-
forEachMetaEntry
public void forEachMetaEntry(@Nonnull IMetaStore<K> store, @Nonnull IMetaRegistry.MetaEntryConsumer consumer) - Specified by:
forEachMetaEntryin interfaceIMetaRegistry<K>
-
getMetaKeyForCodecKey
- Specified by:
getMetaKeyForCodecKeyin interfaceIMetaRegistry<K>
-