Interface IClassRegistryAPI
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Interface for creating instances
public interface IClassRegistryAPI
- Extension Methods
Properties
BlockClassToTypeMapping
Dictionary<string, Type> BlockClassToTypeMapping { get; }
Property Value
ItemClassToTypeMapping
Dictionary<string, Type> ItemClassToTypeMapping { get; }
Property Value
Methods
CreateBlock(string)
Creates a block instance from given block class
Block CreateBlock(string blockclass)
Parameters
blockclass
string
Returns
CreateBlockBehavior(Block, string)
Creates a block behavior instance from given behavior code
BlockBehavior CreateBlockBehavior(Block forBlock, string code)
Parameters
Returns
CreateBlockEntity(string)
Creates a block entity instance from given block entity class
BlockEntity CreateBlockEntity(string blockEntityClass)
Parameters
blockEntityClass
string
Returns
CreateBlockEntityBehavior(BlockEntity, string)
Creates a block entity behavior instance for given block entity
BlockEntityBehavior CreateBlockEntityBehavior(BlockEntity blockEntity, string name)
Parameters
blockEntity
BlockEntityname
string
Returns
CreateCollectibleBehavior(CollectibleObject, string)
Creates a collectible behavior instance from given behavior code
CollectibleBehavior CreateCollectibleBehavior(CollectibleObject forCollectible, string code)
Parameters
forCollectible
CollectibleObjectcode
string
Returns
CreateCropBehavior(Block, string)
Creates a crop behavior instance from given block class
CropBehavior CreateCropBehavior(Block forBlock, string cropBehaviorName)
Parameters
Returns
CreateEntity(string)
Creates a entity instance from given entity class
Entity CreateEntity(string entityClass)
Parameters
entityClass
string
Returns
CreateEntity(EntityProperties)
Creates a entity instance from given entity type
Entity CreateEntity(EntityProperties entityType)
Parameters
entityType
EntityProperties
Returns
CreateEntityBehavior(Entity, string)
Creates a block behavior instance from given block class
EntityBehavior CreateEntityBehavior(Entity forEntity, string entityBehaviorName)
Parameters
Returns
CreateInvNetworkUtil(InventoryBase, ICoreAPI)
IInventoryNetworkUtil CreateInvNetworkUtil(InventoryBase inv, ICoreAPI api)
Parameters
inv
InventoryBaseapi
ICoreAPI
Returns
CreateItem(string)
Creates an item instance from given item class
Item CreateItem(string itemclass)
Parameters
itemclass
string
Returns
CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute>)
Creates a json serializable version of an ITreeAttribute
JsonTreeAttribute CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute> attributes)
Parameters
attributes
Dictionary<string, JsonTreeAttribute>
Returns
CreateParticlePropertyProvider(string)
IParticlePropertiesProvider CreateParticlePropertyProvider(string className)
Parameters
className
string
Returns
CreateParticlePropertyProvider(Type)
IParticlePropertiesProvider CreateParticlePropertyProvider(Type entityType)
Parameters
entityType
Type
Returns
GetBlockBehaviorClass(string)
Returns the block behavior type registered for given name or null
Type GetBlockBehaviorClass(string code)
Parameters
code
string
Returns
GetBlockBehaviorClassName(Type)
string GetBlockBehaviorClassName(Type blockBehaviorType)
Parameters
blockBehaviorType
Type
Returns
GetBlockClass(string)
Returns the type of the registered block class or null otherwise
Type GetBlockClass(string blockclass)
Parameters
blockclass
string
Returns
GetBlockEntity(string)
Returns the type for given BlockEntity class name as register in the ClassRegistry
Type GetBlockEntity(string bockEntityClass)
Parameters
bockEntityClass
string
Returns
GetBlockEntityBehaviorClass(string)
Returns the block entity behavior type if such is registered under supplied name
Type GetBlockEntityBehaviorClass(string name)
Parameters
name
string
Returns
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
GetCollectibleBehaviorClass(string)
Returns the collectible behavior type registered for given name or null
Type GetCollectibleBehaviorClass(string code)
Parameters
code
string
Returns
GetCollectibleBehaviorClassName(Type)
string GetCollectibleBehaviorClassName(Type blockBehaviorType)
Parameters
blockBehaviorType
Type
Returns
GetEntityBehaviorClass(string)
Type GetEntityBehaviorClass(string entityBehaviorName)
Parameters
entityBehaviorName
string
Returns
GetEntityClassName(Type)
Returns the entity class code if give Type is a registered entity class
string GetEntityClassName(Type entityType)
Parameters
entityType
Type
Returns
GetItemClass(string)
Gets the registered item type or null if not registered
Type GetItemClass(string itemClass)
Parameters
itemClass
string
Returns
GetMountable(TreeAttribute)
Creates an instance of a mountable that has been registered with api.RegisterMountable
IMountableSeat GetMountable(TreeAttribute tree)
Parameters
tree
TreeAttribute
Returns
RegisterParticlePropertyProvider(string, Type)
void RegisterParticlePropertyProvider(string className, Type ParticleProvider)