Interface ICustomPlayerConfigGroupAPI
- All Superinterfaces:
ICustomPlayerConfigGroupDataAPI
API for a custom player config group
-
Method Summary
Modifier and TypeMethodDescriptioncopyData()Creates a copy of the stored data.excludeGroup(String groupId) Attempts to exclude the group with a specified ID from this group.excludeMember(UUID id, String name) Attempts to exclude the member entry with a specified UUID and/or name from this group.Attempts to exclude a specified member entry from this group.Gets a set containing all group IDs directly included in this group.Gets a set of member entries directly included in this group.intgetSize()Gets the size of this custom player group (included members and groups).booleangroupIdIsIncluded(String groupId) Checks whether a specified group ID is included in this group.includeGroup(String groupId) Attempts to include the group with a specified ID in this group.includeGroupLimited(String groupId) Attempts to include the group with a specified ID in this group.com.mojang.datafixers.util.Either<ICustomPlayerGroupMemberAPI,PlayerConfigGroupActionError> includeMember(UUID id, String name) Attempts to include a member in this group using specified UUID or player name.com.mojang.datafixers.util.Either<ICustomPlayerGroupMemberAPI,PlayerConfigGroupActionError> includeMemberLimited(UUID id, String name) Attempts to include a member in this group using specified UUID or player name.booleanplayerIdIsIncluded(UUID playerId) Checks whether the player with a specified UUID is one of the member entries.booleanplayerNameIsIncluded(String name) Checks whether a specified player name is one of the member entries.
-
Method Details
-
copyData
Description copied from interface:ICustomPlayerConfigGroupDataAPICreates a copy of the stored data.- Specified by:
copyDatain interfaceICustomPlayerConfigGroupDataAPI- Returns:
- the copy, not null
-
getSize
int getSize()Description copied from interface:ICustomPlayerConfigGroupDataAPIGets the size of this custom player group (included members and groups).- Specified by:
getSizein interfaceICustomPlayerConfigGroupDataAPI- Returns:
- the size of the data
-
getDirectMembers
Description copied from interface:ICustomPlayerConfigGroupDataAPIGets a set of member entries directly included in this group.- Specified by:
getDirectMembersin interfaceICustomPlayerConfigGroupDataAPI- Returns:
- the set of direct member entries, not null
-
getDirectGroupIds
Description copied from interface:ICustomPlayerConfigGroupDataAPIGets a set containing all group IDs directly included in this group.- Specified by:
getDirectGroupIdsin interfaceICustomPlayerConfigGroupDataAPI- Returns:
- the set of directly included group IDs, not null
-
playerIdIsIncluded
Description copied from interface:ICustomPlayerConfigGroupDataAPIChecks whether the player with a specified UUID is one of the member entries.- Specified by:
playerIdIsIncludedin interfaceICustomPlayerConfigGroupDataAPI- Parameters:
playerId- the ID of the player, not null- Returns:
- true if one of the member entries corresponds to the ID, otherwise false
-
playerNameIsIncluded
Description copied from interface:ICustomPlayerConfigGroupDataAPIChecks whether a specified player name is one of the member entries.- Specified by:
playerNameIsIncludedin interfaceICustomPlayerConfigGroupDataAPI- Parameters:
name- the player name, can be null- Returns:
- true if the specified player name is not null and corresponds to a member entry, otherwise false
-
groupIdIsIncluded
Description copied from interface:ICustomPlayerConfigGroupDataAPIChecks whether a specified group ID is included in this group.- Specified by:
groupIdIsIncludedin interfaceICustomPlayerConfigGroupDataAPI- Parameters:
groupId- the group ID, can be null- Returns:
- true if the specified group ID is not null and corresponds to a group entry, otherwise false
-
includeMember
@Nonnull com.mojang.datafixers.util.Either<ICustomPlayerGroupMemberAPI,PlayerConfigGroupActionError> includeMember(@Nullable UUID id, @Nullable String name) Attempts to include a member in this group using specified UUID or player name.At least one of the player identified must be non-null.
- Parameters:
id- the UUID of the player to include, must not be null if the name isname- the name of the player to include, must not be null if the id is- Returns:
- an
Eitherinstance with either the added member entry on the left or an error on the rightPlayerConfigGroupActionError
-
includeMemberLimited
@Nonnull com.mojang.datafixers.util.Either<ICustomPlayerGroupMemberAPI,PlayerConfigGroupActionError> includeMemberLimited(@Nullable UUID id, @Nullable String name) Attempts to include a member in this group using specified UUID or player name.Unlike
includeMember(UUID, String), this method takes additional limitations into account, such as the player group space available for non-op players.At least one of the player identified must be non-null.
- Parameters:
id- the UUID of the player to include, must not be null if the name isname- the name of the player to include, must not be null if the id is- Returns:
- an
Eitherinstance with either the added member entry on the left or an error on the rightPlayerConfigGroupActionError
-
excludeMember
@Nonnull Optional<PlayerConfigGroupActionError> excludeMember(@Nonnull ICustomPlayerGroupMemberAPI member) Attempts to exclude a specified member entry from this group.- Parameters:
member- the member entry, not null- Returns:
- an
OptionalerrorPlayerConfigGroupActionError
-
excludeMember
@Nonnull Optional<PlayerConfigGroupActionError> excludeMember(@Nullable UUID id, @Nullable String name) Attempts to exclude the member entry with a specified UUID and/or name from this group.- Parameters:
id- the player UUID of the member entry, can be nullname- the player name of the member entry, can be null- Returns:
- an
OptionalerrorPlayerConfigGroupActionError
-
includeGroup
Attempts to include the group with a specified ID in this group.- Parameters:
groupId- the ID of the group to include, not null- Returns:
- an
OptionalerrorPlayerConfigGroupActionError
-
includeGroupLimited
Attempts to include the group with a specified ID in this group.Unlike
includeGroup(String), this method takes additional limitations into account, such as the player group space available for non-op players.- Parameters:
groupId- the ID of the group to include, not null- Returns:
- an
OptionalerrorPlayerConfigGroupActionError
-
excludeGroup
Attempts to exclude the group with a specified ID from this group.- Parameters:
groupId- the ID of the group to exclude, not null- Returns:
- an
OptionalerrorPlayerConfigGroupActionError
-