OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Class ItemDirectoryExtensions

Inheritance
System.Object
ItemDirectoryExtensions
Namespace: OpenMod.Extensions.Games.Abstractions.Items
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public static class ItemDirectoryExtensions : object

Methods

| Improve this Doc View Source

FindByIdAsync(IItemDirectory, String)

Searches for items by the item asset id.

Declaration
public static Task<IItemAsset> FindByIdAsync(this IItemDirectory directory, string itemAssetId)
Parameters
Type Name Description
IItemDirectory directory

The item directory service.

System.String itemAssetId

The item asset id to search for.

Returns
Type Description
Task<IItemAsset>

The IItemAsset if found; otherwise, null.

| Improve this Doc View Source

FindByNameAsync(IItemDirectory, String, Boolean)

Searches for items by the item asset name.

Declaration
public static Task<IItemAsset> FindByNameAsync(this IItemDirectory directory, string itemName, bool exact = true)
Parameters
Type Name Description
IItemDirectory directory

The item directory service.

System.String itemName

The name of the item asset.

System.Boolean exact

If true, only exact name matches will be used.

Returns
Type Description
Task<IItemAsset>

The IItemAsset if found; otherwise, null.