Interface IServerPlayerConfigGroupManagerAPI

All Superinterfaces:
ICustomPlayerConfigGroupDataManagerAPI

public interface IServerPlayerConfigGroupManagerAPI extends ICustomPlayerConfigGroupDataManagerAPI
API for player groups of a player config on the server side
  • Method Details

    • getMaxGroups

      int getMaxGroups()
      Description copied from interface: ICustomPlayerConfigGroupDataManagerAPI
      Gets the maximum number of groups that a non-op player can create in this group manager.
      Specified by:
      getMaxGroups in interface ICustomPlayerConfigGroupDataManagerAPI
      Returns:
      the group count limit for non-op players
    • getGroupSpace

      int getGroupSpace()
      Description copied from interface: ICustomPlayerConfigGroupDataManagerAPI
      Gets the total group space available in this group manager for non-op players.
      Specified by:
      getGroupSpace in interface ICustomPlayerConfigGroupDataManagerAPI
      Returns:
      the total group space available to non-op players
    • getAllIdsSorted

      @Nonnull List<String> getAllIdsSorted()
      Description copied from interface: ICustomPlayerConfigGroupDataManagerAPI
      Gets a sorted list of all group IDs that can be used as config option exception values in this config.

      This means that the list always includes player groups from the default player config.

      Specified by:
      getAllIdsSorted in interface ICustomPlayerConfigGroupDataManagerAPI
      Returns:
      the list of all IDs usable as config option exception values
    • dataExists

      boolean dataExists(@Nonnull String id)
      Description copied from interface: ICustomPlayerConfigGroupDataManagerAPI
      Checks whether a specified group ID corresponds to one of the custom groups whose data is stored in this group manager.
      Specified by:
      dataExists in interface ICustomPlayerConfigGroupDataManagerAPI
      Parameters:
      id - the group ID, not null
      Returns:
      true if this manager stores data for a custom group with the ID, otherwise false
    • getCustom

      @Nullable ICustomPlayerConfigGroupAPI getCustom(@Nonnull String id)
      Gets the API for the custom group with a specified ID in this group manager.
      Parameters:
      id - the custom group ID, not null
      Returns:
      the API for the custom group, null if it doesn't exist
    • addCustom

      @Nonnull com.mojang.datafixers.util.Either<ICustomPlayerConfigGroupAPI,PlayerConfigGroupActionError> addCustom(@Nonnull String id)
      Attempts to add a new custom group to this group manager with a specified ID.

      Gets either the created custom group or an error.

      Parameters:
      id - the ID for the new custom group, not null
      Returns:
      an Either instance with either the created group on the left or an error on the right PlayerConfigGroupActionError.
    • addCustomLimited

      @Nonnull com.mojang.datafixers.util.Either<ICustomPlayerConfigGroupAPI,PlayerConfigGroupActionError> addCustomLimited(@Nonnull String id)
      Attempts to add a new custom group to this group manager with a specified ID.

      Unlike addCustom(String), this method takes more limitations into account, such as the group count limits. Gets either the created custom group or an error.

      Parameters:
      id - the ID for the new custom group, not null
      Returns:
      an Either instance with either the created group on the left or an error on the right PlayerConfigGroupActionError.
    • removeCustom

      @Nonnull Optional<PlayerConfigGroupActionError> removeCustom(@Nonnull String id)
      Attempts to remove a custom group from this group manager with a specified ID.

      May return an error.

      Parameters:
      id - the ID of the custom group to remove, not null
      Returns:
      an Optional instance which may contain an error PlayerConfigGroupActionError
    • getUnwrapped

      @Nullable IPlayerConfigGroupAPI getUnwrapped(@Nonnull String id)
      Gets the group with a specified ID without wrapping groups that originate from the default player config.

      An unwrapped default player config player group is not aware of this group manager or config, so it won't support any default group extensions that the owner of this player config may have declared.

      Parameters:
      id - the id of the group, not null
      Returns:
      the group corresponding to the id, null if it doesn't exist
    • get

      @Nullable IPlayerConfigGroupAPI get(@Nonnull String id)
      Gets the group with a specified ID and wraps the group if it originates from the default player config.

      A wrapped default player config player group is aware of this group manager, so it supports the default group extensions that the owner of this player config may have declared.

      Parameters:
      id - the id of the group, not null
      Returns:
      the group corresponding to the id, null if it doesn't exist