Package io.papermc.paper.registry.set
Interface RegistrySet<T>
- Type Parameters:
- T- registry value type
- All Known Subinterfaces:
- RegistryKeySet<T>,- RegistryValueSet<T>,- Tag<T>
@Experimental
@NullMarked
public sealed interface RegistrySet<T>
permits RegistryKeySet<T>, RegistryValueSet<T>
Represents a collection tied to a registry.
 
There are 2 types of registry sets:
- Tagwhich is a tag from vanilla or a datapack. These are obtained via- Registry.getTag(io.papermc.paper.registry.tag.TagKey).
- RegistryKeySetwhich is a set of of keys linked to values that are present in the registry. These are created via- keySet(RegistryKey, Iterable)or- keySetFromValues(RegistryKey, Iterable).
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanisEmpty()Checks if the registry set is empty.static <T extends Keyed>
 RegistryKeySet<T> keySet(RegistryKey<T> registryKey, TypedKey<T>... keys) Creates a directRegistrySetfromTypedKeys.static <T extends Keyed>
 RegistryKeySet<T> keySet(RegistryKey<T> registryKey, Iterable<TypedKey<T>> keys) Creates a directRegistrySetfromTypedKeys.static <T extends Keyed>
 RegistryKeySet<T> keySetFromValues(RegistryKey<T> registryKey, Iterable<? extends T> values) Creates aRegistryKeySetfrom registry-backed values.Get the registry key for this set.intsize()Get the size of this set.
- 
Method Details- 
keySetFromValues@Contract(value="_, _ -> new", pure=true) static <T extends Keyed> RegistryKeySet<T> keySetFromValues(RegistryKey<T> registryKey, Iterable<? extends T> values) Creates aRegistryKeySetfrom registry-backed values.All values provided must have keys in the given registry. If references to actual objects are not available yet, use keySet(RegistryKey, Iterable)to create an equivalentRegistryKeySetusing justTypedKeys.- Type Parameters:
- T- the type of the values
- Parameters:
- registryKey- the registry key for the owner of these values
- values- the values
- Returns:
- a new registry set
- Throws:
- IllegalArgumentException- if the registry isn't available yet or if any value doesn't have a key in that registry
 
- 
keySet@SafeVarargs static <T extends Keyed> RegistryKeySet<T> keySet(RegistryKey<T> registryKey, TypedKey<T>... keys) Creates a directRegistrySetfromTypedKeys.- Type Parameters:
- T- the type of the values
- Parameters:
- registryKey- the registry key for the owner of these keys
- keys- the keys for the values
- Returns:
- a new registry set
 
- 
keySet@Contract(value="_, _ -> new", pure=true) static <T extends Keyed> RegistryKeySet<T> keySet(RegistryKey<T> registryKey, Iterable<TypedKey<T>> keys) Creates a directRegistrySetfromTypedKeys.- Type Parameters:
- T- the type of the values
- Parameters:
- registryKey- the registry key for the owner of these keys
- keys- the keys for the values
- Returns:
- a new registry set
 
- 
registryKeyRegistryKey<T> registryKey()Get the registry key for this set.- Returns:
- the registry key
 
- 
sizeint size()Get the size of this set.- Returns:
- the size
 
- 
isEmptydefault boolean isEmpty()Checks if the registry set is empty.- Returns:
- true, if empty
 
 
-