Class HytaleServerConfig.Module

java.lang.Object
com.hypixel.hytale.server.core.HytaleServerConfig.Module
Enclosing class:
HytaleServerConfig

public static class HytaleServerConfig.Module extends Object
Represents the configuration for a specific module within the server.
  • Field Details

  • 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:
      true if the module is enabled, false otherwise.
    • setEnabled

      public void setEnabled(boolean enabled)
      Called to set whether this module is enabled.
      Parameters:
      enabled - The new enabled state to set.
    • getEnabled

      public Boolean getEnabled()
      Returns:
      true if the module is enabled, false otherwise.
    • getModules

      @Nonnull public Map<String, HytaleServerConfig.Module> getModules()
      Returns:
      a map of submodule names to their corresponding HytaleServerConfig.Module configurations.
    • getModule

      @Nonnull public HytaleServerConfig.Module getModule(@Nonnull String moduleName)
      Called to get the submodule configuration for the specified submodule name.
      Parameters:
      moduleName - The name of the submodule.
      Returns:
      the submodule configuration.
    • setModules

      public void setModules(@Nonnull Map<String, HytaleServerConfig.Module> modules)
      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

      @Nullable public <T> T decode(@Nonnull Codec<T> codec)
      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 null if decoding failed.
    • encode

      public <T> void encode(@Nonnull Codec<T> codec, @Nonnull T t)
      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

      @Nonnull public <T> Optional<T> getData(@Nonnull KeyedCodec<T> keyedCodec)
      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

      @Nullable public <T> T getDataOrNull(@Nonnull KeyedCodec<T> keyedCodec)
      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 null if not present.
    • getDataNow

      public <T> T getDataNow(@Nonnull KeyedCodec<T> keyedCodec)
      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

      public <T> void put(@Nonnull KeyedCodec<T> keyedCodec, T t)
      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.