Contents
Class HytaleServerConfig.Module
java.lang.Object
com.hypixel.hytale.server.core.HytaleServerConfig.Module
- Enclosing class:
HytaleServerConfig
Represents the configuration for a specific module within the server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DocumentContainingCodec<HytaleServerConfig.Module> The codec used to store additional document data for the module. -
Method Summary
Modifier and TypeMethodDescription<T> TCalled to decode additional data from the module's document using the specified codec.<T> voidCalled to encode additional data into the module's document using the specified codec.<T> Optional<T> getData(KeyedCodec<T> keyedCodec) Called to get additional data from the module's document using the specified keyed codec.<T> TgetDataNow(KeyedCodec<T> keyedCodec) Called to get additional data from the module's document using the specified keyed codec.<T> TgetDataOrNull(KeyedCodec<T> keyedCodec) Called to get additional data from the module's document using the specified keyed codec.org.bson.BsonDocumentCalled to get the submodule configuration for the specified submodule name.booleanisEnabled(boolean def) Determines whether this module is enabled.<T> voidput(KeyedCodec<T> keyedCodec, T t) Called to put additional data into the module's document using the specified keyed codec.voidsetDocument(org.bson.BsonDocument document) Called to set the BSON document containing additional data for the module.voidsetEnabled(boolean enabled) Called to set whether this module is enabled.voidsetModules(Map<String, HytaleServerConfig.Module> modules) Called to set the submodule configurations.
-
Field Details
-
CODEC
The codec used to store additional document data for the module.
-
-
Method Details
-
isEnabled
public boolean isEnabled(boolean def) Determines whether this module is enabled.- Parameters:
def- The default value to return if the enabled state is not set.- Returns:
trueif the module is enabled,falseotherwise.
-
setEnabled
public void setEnabled(boolean enabled) Called to set whether this module is enabled.- Parameters:
enabled- The new enabled state to set.
-
getEnabled
- Returns:
trueif the module is enabled,falseotherwise.
-
getModules
- Returns:
- a map of submodule names to their corresponding
HytaleServerConfig.Moduleconfigurations.
-
getModule
Called to get the submodule configuration for the specified submodule name.- Parameters:
moduleName- The name of the submodule.- Returns:
- the submodule configuration.
-
setModules
Called to set the submodule configurations.- Parameters:
modules- The new submodule configurations to set.
-
getDocument
@Nonnull public org.bson.BsonDocument getDocument()- Returns:
- the BSON document containing additional data for the module.
-
decode
Called to decode additional data from the module's document using the specified codec.- Type Parameters:
T- The type of the decoded data.- Parameters:
codec- The codec to use for decoding.- Returns:
- the decoded data, or
nullif decoding failed.
-
encode
Called to encode additional data into the module's document using the specified codec.- Type Parameters:
T- The type of the data to encode.- Parameters:
codec- The codec to use for encoding.t- The data to encode.
-
getData
Called to get additional data from the module's document using the specified keyed codec.- Type Parameters:
T- The type of the data.- Parameters:
keyedCodec- The keyed codec to use for getting the data.- Returns:
- the optional data.
-
getDataOrNull
Called to get additional data from the module's document using the specified keyed codec.- Type Parameters:
T- The type of the data.- Parameters:
keyedCodec- The keyed codec to use for getting the data.- Returns:
- the data, or
nullif not present.
-
getDataNow
Called to get additional data from the module's document using the specified keyed codec.- Type Parameters:
T- The type of the data.- Parameters:
keyedCodec- The keyed codec to use for getting the data.- Returns:
- the data, or the default value if not present.
-
put
Called to put additional data into the module's document using the specified keyed codec.- Type Parameters:
T- The type of the data.- Parameters:
keyedCodec- The keyed codec to use for putting the data.t- The data to put.
-
setDocument
public void setDocument(@Nonnull org.bson.BsonDocument document) Called to set the BSON document containing additional data for the module.- Parameters:
document- The new BSON document to set.
-