Package net.minestom.server.tag
Interface Taggable
- All Superinterfaces:
TagReadable
,TagWritable
- All Known Subinterfaces:
CommandSender
- All Known Implementing Classes:
AbstractInventory
,AnvilInventory
,BeaconInventory
,BrewingStandInventory
,Chunk
,ConsoleSender
,Damage
,DynamicChunk
,EnchantmentTableInventory
,Entity
,EntityCreature
,EntityDamage
,EntityProjectile
,EntityProjectileDamage
,ExperienceOrb
,FurnaceInventory
,Instance
,InstanceContainer
,Inventory
,ItemEntity
,LightingChunk
,LivingEntity
,Player
,PlayerInventory
,PositionalDamage
,ServerSender
,SharedInstance
,VillagerInventory
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> T
getAndSetTag
(@NotNull Tag<T> tag, T value) Reads the current value, and then write the new one.default <T> @UnknownNullability T
getAndUpdateTag
(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) default <T> @UnknownNullability T
Reads the specified tag.default boolean
Returns if a tag is present.default void
default <T> void
Writes the specified type.@NotNull TagHandler
default <T> @UnknownNullability T
updateAndGetTag
(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value) default <T> void
updateTag
(@NotNull Tag<T> tag, @NotNull UnaryOperator<@UnknownNullability T> value)
-
Method Details
-
tagHandler
-
getTag
Description copied from interface:TagReadable
Reads the specified tag.- Specified by:
getTag
in interfaceTagReadable
- Type Parameters:
T
- the tag type- Parameters:
tag
- the tag to read- Returns:
- the read tag, null if not present
-
hasTag
Description copied from interface:TagReadable
Returns if a tag is present.- Specified by:
hasTag
in interfaceTagReadable
- Parameters:
tag
- the tag to check- Returns:
- true if the tag is present, false otherwise
-
setTag
Description copied from interface:TagWritable
Writes the specified type.- Specified by:
setTag
in interfaceTagWritable
- Type Parameters:
T
- the tag type- Parameters:
tag
- the tag to writevalue
- the tag value, null to remove
-
removeTag
- Specified by:
removeTag
in interfaceTagWritable
-
getAndSetTag
Description copied from interface:TagWritable
Reads the current value, and then write the new one.- Specified by:
getAndSetTag
in interfaceTagWritable
- Type Parameters:
T
- the tag type- Parameters:
tag
- the tag to writevalue
- the tag value, null to remove- Returns:
- the previous tag value, null if not present
-
updateTag
default <T> void updateTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
updateTag
in interfaceTagWritable
-
updateAndGetTag
default <T> @UnknownNullability T updateAndGetTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
updateAndGetTag
in interfaceTagWritable
-
getAndUpdateTag
default <T> @UnknownNullability T getAndUpdateTag(@NotNull @NotNull Tag<T> tag, @NotNull @NotNull UnaryOperator<@UnknownNullability T> value) - Specified by:
getAndUpdateTag
in interfaceTagWritable
-