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> TgetAndSetTag(Tag<T> tag, T value) Reads the current value, and then write the new one.default <T> @UnknownNullability TgetAndUpdateTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value) default <T> @UnknownNullability TReads the specified tag.default booleanReturns if a tag is present.default voiddefault <T> voidWrites the specified type.default <T> @UnknownNullability TupdateAndGetTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value) default <T> voidupdateTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value)
-
Method Details
-
tagHandler
TagHandler tagHandler() -
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin 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:TagReadableReturns if a tag is present.- Specified by:
hasTagin interfaceTagReadable- Parameters:
tag- the tag to check- Returns:
- true if the tag is present, false otherwise
-
setTag
Description copied from interface:TagWritableWrites the specified type.- Specified by:
setTagin interfaceTagWritable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to writevalue- the tag value, null to remove
-
removeTag
- Specified by:
removeTagin interfaceTagWritable
-
getAndSetTag
Description copied from interface:TagWritableReads the current value, and then write the new one.- Specified by:
getAndSetTagin 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
- Specified by:
updateTagin interfaceTagWritable
-
updateAndGetTag
default <T> @UnknownNullability T updateAndGetTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value) - Specified by:
updateAndGetTagin interfaceTagWritable
-
getAndUpdateTag
default <T> @UnknownNullability T getAndUpdateTag(Tag<T> tag, UnaryOperator<@UnknownNullability T> value) - Specified by:
getAndUpdateTagin interfaceTagWritable
-