Table of Contents

Interface IClassRegistryAPI

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Interface for creating instances

public interface IClassRegistryAPI

Properties

BlockClassToTypeMapping

Dictionary<string, Type> BlockClassToTypeMapping { get; }

Property Value

Dictionary<string, Type>

ItemClassToTypeMapping

Dictionary<string, Type> ItemClassToTypeMapping { get; }

Property Value

Dictionary<string, Type>

Methods

CreateBlock(string)

Creates a block instance from given block class

Block CreateBlock(string blockclass)

Parameters

blockclass string

Returns

Block

CreateBlockBehavior(Block, string)

Creates a block behavior instance from given behavior code

BlockBehavior CreateBlockBehavior(Block forBlock, string code)

Parameters

forBlock Block
code string

Returns

BlockBehavior

CreateBlockEntity(string)

Creates a block entity instance from given block entity class

BlockEntity CreateBlockEntity(string blockEntityClass)

Parameters

blockEntityClass string

Returns

BlockEntity

CreateBlockEntityBehavior(BlockEntity, string)

Creates a block entity behavior instance for given block entity

BlockEntityBehavior CreateBlockEntityBehavior(BlockEntity blockEntity, string name)

Parameters

blockEntity BlockEntity
name string

Returns

BlockEntityBehavior

CreateCollectibleBehavior(CollectibleObject, string)

Creates a collectible behavior instance from given behavior code

CollectibleBehavior CreateCollectibleBehavior(CollectibleObject forCollectible, string code)

Parameters

forCollectible CollectibleObject
code string

Returns

CollectibleBehavior

CreateCropBehavior(Block, string)

Creates a crop behavior instance from given block class

CropBehavior CreateCropBehavior(Block forBlock, string cropBehaviorName)

Parameters

forBlock Block
cropBehaviorName string

Returns

CropBehavior

CreateEntity(string)

Creates a entity instance from given entity class

Entity CreateEntity(string entityClass)

Parameters

entityClass string

Returns

Entity

CreateEntity(EntityProperties)

Creates a entity instance from given entity type

Entity CreateEntity(EntityProperties entityType)

Parameters

entityType EntityProperties

Returns

Entity

CreateEntityBehavior(Entity, string)

Creates a block behavior instance from given block class

EntityBehavior CreateEntityBehavior(Entity forEntity, string entityBehaviorName)

Parameters

forEntity Entity
entityBehaviorName string

Returns

EntityBehavior

CreateInvNetworkUtil(InventoryBase, ICoreAPI)

IInventoryNetworkUtil CreateInvNetworkUtil(InventoryBase inv, ICoreAPI api)

Parameters

inv InventoryBase
api ICoreAPI

Returns

IInventoryNetworkUtil

CreateItem(string)

Creates an item instance from given item class

Item CreateItem(string itemclass)

Parameters

itemclass string

Returns

Item

CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute>)

Creates a json serializable version of an ITreeAttribute

JsonTreeAttribute CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute> attributes)

Parameters

attributes Dictionary<string, JsonTreeAttribute>

Returns

JsonTreeAttribute

CreateMountable(TreeAttribute)

Creates an instance of a mountable that has been registered with api.RegisterMountable

IMountable CreateMountable(TreeAttribute tree)

Parameters

tree TreeAttribute

Returns

IMountable

CreateParticlePropertyProvider(string)

IParticlePropertiesProvider CreateParticlePropertyProvider(string className)

Parameters

className string

Returns

IParticlePropertiesProvider

CreateParticlePropertyProvider(Type)

IParticlePropertiesProvider CreateParticlePropertyProvider(Type entityType)

Parameters

entityType Type

Returns

IParticlePropertiesProvider

GetBlockBehaviorClass(string)

Returns the block behavior type registered for given name or null

Type GetBlockBehaviorClass(string code)

Parameters

code string

Returns

Type

GetBlockBehaviorClassName(Type)

string GetBlockBehaviorClassName(Type blockBehaviorType)

Parameters

blockBehaviorType Type

Returns

string

GetBlockClass(string)

Returns the type of the registered block class or null otherwise

Type GetBlockClass(string blockclass)

Parameters

blockclass string

Returns

Type

GetBlockEntity(string)

Returns the type for given BlockEntity class name as register in the ClassRegistry

Type GetBlockEntity(string bockEntityClass)

Parameters

bockEntityClass string

Returns

Type

GetBlockEntityBehaviorClass(string)

Returns the block entity behavior type if such is registered under supplied name

Type GetBlockEntityBehaviorClass(string name)

Parameters

name string

Returns

Type

GetBlockEntityClass(Type)

Returns the block entity class code if give Type is a registered block entity class

string GetBlockEntityClass(Type type)

Parameters

type Type

Returns

string

GetCollectibleBehaviorClass(string)

Returns the collectible behavior type registered for given name or null

Type GetCollectibleBehaviorClass(string code)

Parameters

code string

Returns

Type

GetCollectibleBehaviorClassName(Type)

string GetCollectibleBehaviorClassName(Type blockBehaviorType)

Parameters

blockBehaviorType Type

Returns

string

GetEntityBehaviorClass(string)

Type GetEntityBehaviorClass(string entityBehaviorName)

Parameters

entityBehaviorName string

Returns

Type

GetEntityClassName(Type)

Returns the entity class code if give Type is a registered entity class

string GetEntityClassName(Type entityType)

Parameters

entityType Type

Returns

string

GetItemClass(string)

Gets the registered item type or null if not registered

Type GetItemClass(string itemClass)

Parameters

itemClass string

Returns

Type

RegisterParticlePropertyProvider(string, Type)

void RegisterParticlePropertyProvider(string className, Type ParticleProvider)

Parameters

className string
ParticleProvider Type