Package org.empirewar.orbis.flag
Class GroupedMutableRegionFlag<T>
java.lang.Object
org.empirewar.orbis.flag.RegionFlag<T>
org.empirewar.orbis.flag.MutableRegionFlag<T>
org.empirewar.orbis.flag.GroupedMutableRegionFlag<T>
- Type Parameters:
T- the type this flag has
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed
Represents a flag that affects a specific set of
FlagMemberGroups.
By default, a MutableRegionFlag will affect all players regardless of whether they are a region member or not.
This class allows for a flag to only apply to specific groups.
A RegistryRegionFlag may be converted to a Grouped instance by calling RegistryRegionFlag.asGrouped().
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GroupedMutableRegionFlag<?>> Fields inherited from class org.empirewar.orbis.flag.MutableRegionFlag
TYPE_CODECFields inherited from class org.empirewar.orbis.flag.RegionFlag
codec, key -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroup(FlagMemberGroup group) com.mojang.serialization.MapCodec<? extends GroupedMutableRegionFlag<T>> getCodec(RegistryRegionFlag<?> registry) Gets the codec for this flag.getType()groups()Gets the set of groups this flag is affected by.voidremoveGroup(FlagMemberGroup group) Methods inherited from class org.empirewar.orbis.flag.MutableRegionFlag
getValue, setValueMethods inherited from class org.empirewar.orbis.flag.RegionFlag
equals, hashCode, key, typeCodec
-
Field Details
-
CODEC
-
-
Method Details
-
groups
Gets the set of groups this flag is affected by.- Returns:
- groups affecting this flag
-
addGroup
-
removeGroup
-
getType
- Overrides:
getTypein classMutableRegionFlag<T>
-
getCodec
public com.mojang.serialization.MapCodec<? extends GroupedMutableRegionFlag<T>> getCodec(RegistryRegionFlag<?> registry) Description copied from class:RegionFlagGets the codec for this flag.The parameter provided is the instance of this flag type in the
OrbisRegistries.FLAGSregistry. This allows for transformation within the codec to occur.- Overrides:
getCodecin classMutableRegionFlag<T>- Parameters:
registry- the registry value of this flag- Returns:
- the codec
-