Interface IServerPlayerConfigGroupManagerAPI
- All Superinterfaces:
ICustomPlayerConfigGroupDataManagerAPI
API for player groups of a player config on the server side
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.datafixers.util.Either<ICustomPlayerConfigGroupAPI,PlayerConfigGroupActionError> Attempts to add a new custom group to this group manager with a specified ID.com.mojang.datafixers.util.Either<ICustomPlayerConfigGroupAPI,PlayerConfigGroupActionError> Attempts to add a new custom group to this group manager with a specified ID.booleandataExists(String id) Checks whether a specified group ID corresponds to one of the custom groups whose data is stored in this group manager.Gets the group with a specified ID and wraps the group if it originates from the default player config.Gets a sorted list of all group IDs that can be used as config option exception values in this config.Gets the API for the custom group with a specified ID in this group manager.intGets the total group space available in this group manager for non-op players.intGets the maximum number of groups that a non-op player can create in this group manager.getUnwrapped(String id) Gets the group with a specified ID without wrapping groups that originate from the default player config.removeCustom(String id) Attempts to remove a custom group from this group manager with a specified ID.
-
Method Details
-
getMaxGroups
int getMaxGroups()Description copied from interface:ICustomPlayerConfigGroupDataManagerAPIGets the maximum number of groups that a non-op player can create in this group manager.- Specified by:
getMaxGroupsin interfaceICustomPlayerConfigGroupDataManagerAPI- Returns:
- the group count limit for non-op players
-
getGroupSpace
int getGroupSpace()Description copied from interface:ICustomPlayerConfigGroupDataManagerAPIGets the total group space available in this group manager for non-op players.- Specified by:
getGroupSpacein interfaceICustomPlayerConfigGroupDataManagerAPI- Returns:
- the total group space available to non-op players
-
getAllIdsSorted
Description copied from interface:ICustomPlayerConfigGroupDataManagerAPIGets 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:
getAllIdsSortedin interfaceICustomPlayerConfigGroupDataManagerAPI- Returns:
- the list of all IDs usable as config option exception values
-
dataExists
Description copied from interface:ICustomPlayerConfigGroupDataManagerAPIChecks whether a specified group ID corresponds to one of the custom groups whose data is stored in this group manager.- Specified by:
dataExistsin interfaceICustomPlayerConfigGroupDataManagerAPI- Parameters:
id- the group ID, not null- Returns:
- true if this manager stores data for a custom group with the ID, otherwise false
-
getCustom
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
Eitherinstance with either the created group on the left or an error on the rightPlayerConfigGroupActionError.
-
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
Eitherinstance with either the created group on the left or an error on the rightPlayerConfigGroupActionError.
-
removeCustom
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
Optionalinstance which may contain an errorPlayerConfigGroupActionError
-
getUnwrapped
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
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
-