Table of Contents

Interface ITagRegistry

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public interface ITagRegistry
Extension Methods

Methods

BlockTagIdToTag(ushort)

Returns tag by block tag id. If the tag id is not registered, it will return empty string.

string BlockTagIdToTag(ushort id)

Parameters

id ushort

Block tag id

Returns

string

tag

BlockTagToTagId(string)

Returns tag id of the block tag. If the tag is not registered, it will return 0.

ushort BlockTagToTagId(string tag)

Parameters

tag string

Block tag

Returns

ushort

tag id

BlockTagsToTagArray(params string[])

Converts list of block tags to tags array. Unknown tags are ignored.

BlockTagArray BlockTagsToTagArray(params string[] tags)

Parameters

tags string[]

List of block tags

Returns

BlockTagArray

Tag array suitable for quick comparisons

BlockTagsToTagIds(string[], bool)

Converts a list of block tags to their corresponding tag IDs.
If removeUnknownTags is true, any unknown tags will be removed from the list.
Result is sorted in ascending order.

ushort[] BlockTagsToTagIds(string[] tags, bool removeUnknownTags = false)

Parameters

tags string[]

List of block tags

removeUnknownTags bool

If set to true, not registered tags wont be included in the result

Returns

ushort[]

List of tag ids sorted in ascending order

EntityTagIdToTag(ushort)

Returns tag by entity tag id. If the tag id is not registered, it will return empty string.

string EntityTagIdToTag(ushort id)

Parameters

id ushort

Entity tag id

Returns

string

tag

EntityTagToTagId(string)

Returns tag id of the entity tag. If the tag is not registered, it will return 0.

ushort EntityTagToTagId(string tag)

Parameters

tag string

Entity tag

Returns

ushort

tag id

EntityTagsToTagArray(params string[])

Converts list of entity tags to tags array. Unknown tags are ignored.

EntityTagArray EntityTagsToTagArray(params string[] tags)

Parameters

tags string[]

List of entity tags

Returns

EntityTagArray

Tag array suitable for quick comparisons

EntityTagsToTagIds(string[], bool)

Converts a list of entity tags to their corresponding tag IDs.
If removeUnknownTags is true, any unknown tags will be removed from the list.
Result is sorted in ascending order.

ushort[] EntityTagsToTagIds(string[] tags, bool removeUnknownTags = false)

Parameters

tags string[]

List of entity tags

removeUnknownTags bool

If set to true, not registered tags wont be included in the result

Returns

ushort[]

List of tag ids sorted in ascending order

ItemTagIdToTag(ushort)

Returns tag by item tag id. If the tag id is not registered, it will return empty string.

string ItemTagIdToTag(ushort id)

Parameters

id ushort

Item tag id

Returns

string

tag

ItemTagToTagId(string)

Returns tag id of the item tag. If the tag is not registered, it will return 0.

ushort ItemTagToTagId(string tag)

Parameters

tag string

Item tag

Returns

ushort

tag id

ItemTagsToTagArray(params string[])

Converts list of item tags to tags array. Unknown tags are ignored.

ItemTagArray ItemTagsToTagArray(params string[] tags)

Parameters

tags string[]

List of item tags

Returns

ItemTagArray

Tag array suitable for quick comparisons

ItemTagsToTagIds(string[], bool)

Converts a list of item tags to their corresponding tag IDs.
If removeUnknownTags is true, any unknown tags will be removed from the list.
Result is sorted in ascending order.

ushort[] ItemTagsToTagIds(string[] tags, bool removeUnknownTags = false)

Parameters

tags string[]

List of item tags

removeUnknownTags bool

If set to true, not registered tags wont be included in the result

Returns

ushort[]

List of tag ids sorted in ascending order

LoadTagsFromAssets(ICoreServerAPI)

Loads tags from 'TagRegistry.TagsAssetPath' assets from all domains. Is only used by 'RegistryObjectTypeLoader'. Not meant to be called by mods.

void LoadTagsFromAssets(ICoreServerAPI api)

Parameters

api ICoreServerAPI

RegisterBlockTags(params string[])

Registers new block tags. Should be called only on server side. Should be called no later than 'AssetsFinalize' stage.

void RegisterBlockTags(params string[] tags)

Parameters

tags string[]

RegisterEntityTags(params string[])

Registers new entity tags. Should be called only on server side. Should be called no later than 'AssetsFinalize' stage.

void RegisterEntityTags(params string[] tags)

Parameters

tags string[]

RegisterItemTags(params string[])

Registers new item tags. Should be called only on server side. Should be called no later than 'AssetsFinalize' stage.

void RegisterItemTags(params string[] tags)

Parameters

tags string[]