Package io.papermc.paper.tag
Interface TagEntry<T>
- Type Parameters:
T
- the type of value in the tag
- All Superinterfaces:
Keyed
An entry is a pre-flattened tag. Represents
either an individual registry entry or a whole tag.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns if this entry is required.boolean
isTag()
Returns if this entry represents a tag.static <T> TagEntry
<T> Create a required tag entry for a nested tag.static <T> TagEntry
<T> Create a tag entry for a nested tag.static <T> TagEntry
<T> valueEntry
(TypedKey<T> entryKey) Create required tag entry for a single value.static <T> TagEntry
<T> valueEntry
(TypedKey<T> entryKey, boolean isRequired) Create tag entry for a single value.
-
Method Details
-
valueEntry
Create required tag entry for a single value.- Type Parameters:
T
- the type of value- Parameters:
entryKey
- the key of the entry- Returns:
- a new tag entry for a value
-
valueEntry
@Contract(value="_, _ -> new", pure=true) static <T> TagEntry<T> valueEntry(TypedKey<T> entryKey, boolean isRequired) Create tag entry for a single value.- Type Parameters:
T
- the type of value- Parameters:
entryKey
- the key of the entryisRequired
- if this entry is required (seeisRequired()
)- Returns:
- a new tag entry for a value
-
tagEntry
Create a required tag entry for a nested tag.- Type Parameters:
T
- the type of value- Parameters:
tagKey
- they key for the tag- Returns:
- a new tag entry for a tag
-
tagEntry
@Contract(value="_, _ -> new", pure=true) static <T> TagEntry<T> tagEntry(TagKey<T> tagKey, boolean isRequired) Create a tag entry for a nested tag.- Type Parameters:
T
- the type of value- Parameters:
tagKey
- they key for the tagisRequired
- if this entry is required (seeisRequired()
)- Returns:
- a new tag entry for a tag
-
isTag
Returns if this entry represents a tag.- Returns:
- true if this entry is a tag, false if it is an individual entry
-
isRequired
Returns if this entry is required. If an entry is required, the value or tag must exist on the server in order for the tag to load correctly. A missing value will prevent the tag holding that missing value from being created.- Returns:
- true if this entry is required, false if it is optional
-