Interface IPlayerConfigClientStorageAPI


public interface IPlayerConfigClientStorageAPI
API for a player config storage on the client side
  • Method Details

    • getOptionStorage

      @Nonnull <T extends Comparable<T>> IPlayerConfigStringableOptionClientStorageAPI<?> getOptionStorage(@Nonnull IPlayerConfigOptionSpecAPI<T> option)
      Gets the config option value storage for a specified config option in this config.

      All player config option types are statically accessible in PlayerConfigOptions.

      Type Parameters:
      T - the type of the option value
      Parameters:
      option - the player config option, not null
      Returns:
      the value storage for the config option, not null
    • getType

      @Nonnull PlayerConfigType getType()
      Gets the type PlayerConfigType of this config.
      Returns:
      the type of this config, not null
    • getOwner

      @Nullable UUID getOwner()
      Gets the UUID of the owner of this config.
      Returns:
      the UUID of the owner, null for the wilderness config
    • optionStream

      Gets a stream of all config option value storages for this config.
      Returns:
      the Stream of all config option value storages, not null
    • getSubConfigIds

      @Nonnull List<String> getSubConfigIds()
      Gets an unmodifiable list of all string IDs of this config's sub-configs.
      Returns:
      an unmodifiable List<String> of sub-config IDs
    • getSubConfig

      @Nullable IPlayerConfigClientStorageAPI getSubConfig(@Nonnull String id)
      Gets a sub-config of this config from a specified sub-config ID.

      Gets this config, if the specified sub-config ID is "main".

      Parameters:
      id - the string ID of the sub-config, not null
      Returns:
      the sub-config, null if it doesn't exist
    • getEffectiveSubConfig

      @Nonnull IPlayerConfigClientStorageAPI getEffectiveSubConfig(@Nonnull String id)
      Gets a sub-config of this config from a specified sub-config ID.

      Gets this config, if the specified sub-config ID is "main" or isn't used.

      Parameters:
      id - the string ID of the sub-config, not null
      Returns:
      the effective sub-config, not null
    • subConfigExists

      boolean subConfigExists(@Nonnull String id)
      Checks whether a sub-config with a specified string ID exists.

      Does not consider "main" a sub-config.

      Parameters:
      id - the string ID of the sub-config, not null
      Returns:
      true, if the sub-config exists, otherwise false
    • getSubCount

      int getSubCount()
      Gets the number of sub-configs that this config has.
      Returns:
      the number of sub-configs
    • getSubConfigAPIStream

      @Nonnull Stream<IPlayerConfigClientStorageAPI> getSubConfigAPIStream()
      Gets a stream of all sub-configs of this player config.

      This must not be a sub-config in itself.

      Returns:
      a stream of all sub-configs, not null
    • isBeingDeleted

      boolean isBeingDeleted()
      Checks whether this player (sub-)config is in the process of being deleted.

      This is typically only ever true for sub-configs.

      Returns:
      true if this player (sub-)config is in the process of being deleted, otherwise false
    • getSubConfigLimit

      int getSubConfigLimit()
      Gets the maximum number of sub-configs that this player config is allowed to have.

      Returns 0 if this is a sub-config. Returns the maximum int value if this is a server claims config.

      Returns:
      the sub-config limit