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
blockclassstring
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
blockEntityClassstring
Returns
CreateBlockEntityBehavior(BlockEntity, string)
Creates a block entity behavior instance for given block entity
BlockEntityBehavior CreateBlockEntityBehavior(BlockEntity blockEntity, string name)
Parameters
blockEntityBlockEntitynamestring
Returns
CreateCollectibleBehavior(CollectibleObject, string)
Creates a collectible behavior instance from given behavior code
CollectibleBehavior CreateCollectibleBehavior(CollectibleObject forCollectible, string code)
Parameters
forCollectibleCollectibleObjectcodestring
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
entityClassstring
Returns
CreateEntity(EntityProperties)
Creates a entity instance from given entity type
Entity CreateEntity(EntityProperties entityType)
Parameters
entityTypeEntityProperties
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
invInventoryBaseapiICoreAPI
Returns
CreateItem(string)
Creates an item instance from given item class
Item CreateItem(string itemclass)
Parameters
itemclassstring
Returns
CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute>)
Creates a json serializable version of an ITreeAttribute
JsonTreeAttribute CreateJsonTreeAttributeFromDict(Dictionary<string, JsonTreeAttribute> attributes)
Parameters
attributesDictionary<string, JsonTreeAttribute>
Returns
CreateParticlePropertyProvider(string)
IParticlePropertiesProvider CreateParticlePropertyProvider(string className)
Parameters
classNamestring
Returns
CreateParticlePropertyProvider(Type)
IParticlePropertiesProvider CreateParticlePropertyProvider(Type entityType)
Parameters
entityTypeType
Returns
GetBlockBehaviorClass(string)
Returns the block behavior type registered for given name or null
Type GetBlockBehaviorClass(string code)
Parameters
codestring
Returns
GetBlockBehaviorClassName(Type)
string GetBlockBehaviorClassName(Type blockBehaviorType)
Parameters
blockBehaviorTypeType
Returns
GetBlockClass(string)
Returns the type of the registered block class or null otherwise
Type GetBlockClass(string blockclass)
Parameters
blockclassstring
Returns
GetBlockEntity(string)
Returns the type for given BlockEntity class name as register in the ClassRegistry
Type GetBlockEntity(string bockEntityClass)
Parameters
bockEntityClassstring
Returns
GetBlockEntityBehaviorClass(string)
Returns the block entity behavior type if such is registered under supplied name
Type GetBlockEntityBehaviorClass(string name)
Parameters
namestring
Returns
GetBlockEntityClass(Type)
Returns the block entity class code if give Type is a registered block entity class
string GetBlockEntityClass(Type type)
Parameters
typeType
Returns
GetCollectibleBehaviorClass(string)
Returns the collectible behavior type registered for given name or null
Type GetCollectibleBehaviorClass(string code)
Parameters
codestring
Returns
GetCollectibleBehaviorClassName(Type)
string GetCollectibleBehaviorClassName(Type blockBehaviorType)
Parameters
blockBehaviorTypeType
Returns
GetEntityBehaviorClass(string)
Type GetEntityBehaviorClass(string entityBehaviorName)
Parameters
entityBehaviorNamestring
Returns
GetEntityClassName(Type)
Returns the entity class code if give Type is a registered entity class
string GetEntityClassName(Type entityType)
Parameters
entityTypeType
Returns
GetItemClass(string)
Gets the registered item type or null if not registered
Type GetItemClass(string itemClass)
Parameters
itemClassstring
Returns
GetMountable(TreeAttribute)
Creates an instance of a mountable that has been registered with api.RegisterMountable
IMountableSeat GetMountable(TreeAttribute tree)
Parameters
treeTreeAttribute
Returns
RegisterParticlePropertyProvider(string, Type)
void RegisterParticlePropertyProvider(string className, Type ParticleProvider)