Namespace Vintagestory.API.Common
Classes
- ActiveSlotChangeEventArgs
This contains data about an event that fires when a player changes which slot they're actively using. Such as the currently selected hotbar slot.
- AdvancedParticleProperties
Used to add a set of particle properties to a collectible.
- Animation
Represents a shape animation and can calculate the transformation matrices for each frame to be sent to the shader Process
For each frame, for each root element, calculate the transformation matrix. Curent model matrix is identy mat. 1.1. Get previous and next key frame. Apply translation, rotation and scale to model matrix. 1.2. Store this matrix as animationmatrix in list 1.3. For each child element 1.3.1. Multiply local transformation matrix with the animation matrix. This matrix is now the curent model matrix. Go to 1 with child elements as root elems
For each frame, for each joint 2.1. Calculate the inverse model matrix 2.2. Multiply stored animationmatrix with the inverse model matrix
done
- AnimationMetaData
Animation Meta Data is a json type that controls how an animation should be played.
- AnimationTrigger
Data about when an animation should be triggered.
- AnimatorBase
Syncs every frame with entity.ActiveAnimationsByAnimCode, starts, progresses and stops animations when necessary
- AssetLocation
Defines a complete path to an assets, including it's domain.
- AssetLocationAndSource
Defines a complete path to an assets, including it's domain. Includes an extra Source field for debugging.
- AttachmentPoint
This is a spot on the shape that connects to another shape.
- BagInventory
The contents of one or more bags
- BakingProperties
Baking Properties are collectible attribute used for baking items in a clay oven. You will need to add these attributes if using Bake inside SmeltingType.
- Block
Basic class for a placeable block
- BlockBehavior
Allows for definitions of behaviors of a block that can be applied to any block
- BlockDropItemStack
Represents an itemstack that is dropped when breaking a block, with a potentially random quantity.
- BlockEntity
Basic class for block entities - a data structures to hold custom information for blocks, e.g. for chests to hold it's contents
- BlockEntityBehavior
Basic class for block entities - a data structures to hold custom information for blocks, e.g. for chests to hold it's contents
- BlockEntityBehaviorType
Allows adding behaviors for block entities. Remember, block entities are specific instances of blocks placed within the world.
- BlockLayersAccess
Constants used for GetBlock or GetBlockId calls throughout the engine, to guide whether the block should be read from the solid blocks layer, the fluids layer, or perhaps both.
The game engine supports different block layers in 1.17+. Currently there is a solid blocks layer (e.g. terrain, loose stones, plants, reeds) and a fluid layer (e.g. still water, flowing water, lava, lake ice). Both layers can contain a block at the same position.
Use the .Default value for getting blocks in the general case, use the .Solid/.Fluid value to read from the solid blocks or fluid layer specifically
- BlockSelection
Contains all the information for a players block selection event
- BlockSounds
A set of sounds that are defined for a block. All fields use default or empty sounds if not set.
- ChatCommand
A base class for all chat commands.
- ChatLine
an internal control containing the properties of a chat message.
- ClientAnimator
Syncs every frame with entity.ActiveAnimationsByAnimCode, starts and stops animations when necessary and does recursive interpolation on the rotation, position and scale value for each frame, for each element and for each active element this produces always correctly blended animations but is significantly more costly for the cpu when compared to the technique used by the AnimatorBase.
- ClientChatCommand
A handle for creating client commands.
- CmdArgs
The arguments from a client or sever command
- CollectibleObject
Contains all properties shared by Blocks and Items
- CollectibleParticleProperties
Abstract class used for BlockVoxelParticles and ItemVoxelParticles
- CombustibleProperties
Marks an item as combustible, either by cooking, smelting or firing. This can either imply it is used as a fuel, or can be cooked into another object.
- CompositeShape
Holds shape data to create 3D representations of objects. Also allows shapes to be overlayed on top of one another recursively.
- CraftingRecipeIngredient
A crafting recipe ingredient
- CreativeTabAndStackList
Allows you to add a list of item stacks to put various into creative menu tabs.
- CrushingProperties
Defines a set of properties that allow an object to be ground in a quern.
- DummyInventory
A place holder inventory, useful, e.g., for when you want to render an itemstack and not have it spoil
- DummySlot
A single slot not attached to a given inventory.
- ElementPose
The position of an element.
- EntityAgent
A goal-directed entity which observes and acts upon an environment
- EntityControls
The available controls to move around a character in a game world
- EnumWindBitModeMask
Windmode flags, which can be ORed with existing vertex data to add the specified wind mode (assuming it was 0 previously!)
- ExplosionParticles
A subclass of ExplosionSmokeParticles.
- ExplosionSmokeParticles
Handles the smoke particles of where the explosion was.
- FoodNutritionProperties
Allows you to make collectibles edible, and adds data about their nutrition.
- GridRecipe
Represents a crafting recipe
- GrindingProperties
Defines a set of properties that allow an object to be ground in a quern.
- HeldSounds
Defines a set of sounds for a collectible object.
- InventoryBase
Basic class representing an item inventory
- InventoryBasePlayer
Abstract class used for all inventories that are "on" the player. Any inventory not inheriting from this class will not be stored to the savegame as part of the players inventory.
- InventoryDisplayed
A general purpose inventory which sends update packets to nearby players (used for rendering Display Case, Pulveriser, etc)
- InventoryGeneric
A general purpose inventory
- Item
Represents an in game Item of Vintage Story
- ItemSlot
The default item slot to item stacks
- ItemSlotBackpack
A slot that can hold mobile containers
- ItemSlotOffhand
A slot that only accepts collectibles designated for the off-hand slot
- ItemSlotOutput
A slot from which the player can only take stuff out of, but not place anything in it
- ItemSlotSurvival
Standard survival mode slot that can hold everything except full backpacks
- ItemSlotUniversal
A universal item slot type that can hold anything.
- JsonItemStack
This is a representation of an item stack in JSON. It resembles a standard in-game item stack but can be stored before the game is loaded.
- LoggerBase
Base implementation for ILogger which implements all methods besides a new abstract method LogImpl(EnumLogType, string, params object[]).
- Mod
Represents a mod in the mod manager. May contain zero to multiple ModSystem instances within it.
- ModDependency
Represents a mod dependency requirement of one mod for another.
- ModDependencyAttribute
Applied to a mod assembly multiple times for each required dependency. Superseded by this mod's "modinfo.json" file, if available.
- ModInfo
Meta data for a specific mod folder, archive, source file or assembly. Either loaded from a "modinfo.json" or from the assembly's ModInfoAttribute.
- ModInfoAttribute
Applied to a mod assembly to provide additional meta data information about a code mod. Superseded by "modinfo.json" file, if available.
- ModSystem
Base of a system, which is part of a code mod. Takes care of setting up, registering and handling all sorts of things. You may choose to split up a mod into multiple distinct systems if you so choose, but there may also be just one.
- ModelTransform
Used for transformations applied to a block or item model. Uses values from ModelTransformNoDefaults but will assign defaults if not included.
- ModelTransformKeyFrame
A keyframe for model transformation.
- ModelTransformNoDefaults
Controls the transformations of 3D shapes. Note that defaults change depending on where this class is used.
- MultiblockStructure
You can export one of these by making a selection with worldedit, looking at the center block (which should be your controller/master) then typing /we mgencode. Please note, air blocks are not exported
- NoAnimationManager
A No-Animation Manager built off of IAnimationManager.
- NoAnimator
A NoAnimator built off of IAnimator
- ParticleBase
Represents a particle that has been spawned
- ParticlesProviderBase
A base class for all particle providers.
- RecipeBase<T>
Creates a new base recipe type.
- RegistryObject
A registerable object with variants, i.e. an item, a block or an entity
- ServerChatCommand
A handler for creating server commands.
- Shape
The base shape for all json objects.
- ShapeElement
A shape element built from JSON data within the model.
- SimpleParticleProperties
A configurable implementation of IParticlePropertiesProvider
- StrongBlockBehavior
Same as block behavior but allows even more control over a block, such as the blocks collision boxes and world gen behavior. These are not part of default block behaviors for performance reasons. Requires the block to use the GenericBlock block class (or inherit from it)
- TransitionableProperties
This is a versatile way of allowing a collectible to change to another after a certain time in the inventory.
- VertexFlags
Special class to handle the vertex flagging in a very nicely compressed space.
Bit 0-7: Glow level
Bit 8-10: Z-Offset
Bit 11: Reflective bit
Bit 12: Lod 0 Bit
Bit 13-24: X/Y/Z Normals
Bit 25, 26, 27, 28: Wind mode
Bit 29, 30, 31: Wind data (also sometimes used for other data, e.g. reflection mode if Reflective bit is set, or additional water surface data if this is a water block)
Structs
- SourceStringComponents
For performance, don't build and store new concatenated strings for every block variant, item and entity, when these will only be used (if ever) for error logging
Interfaces
- IAmbientManager
This is the system that manages the worlds ambient settings, such as fog color/density and clouds. The ambient manager basically blends ambientmodifiers on top of each other to generate the final ambient values. Blending is in order how the modifiers are held in CurrentModifiers in the likes of float weight = modifier.FogMin.Weight; BlendedFogMin = w * modifier.FogMin.Value + (1 - w) * BlendedFogMin;
- IAnimationManager
Everything needed for allowing animations the Entity class holds a reference to an IAnimator. Currently implemented by ServerAnimator
- IAsset
Represents a loaded asset from the assets folder
- IAssetManager
Takes care loading, reloading and managing all files inside the assets folder. All asset names and paths are always converted to lower case.
- IBlockAccessor
Provides read/write access to the blocks of a world
- IBlockAccessorPrefetch
Useful for when you have to scan multiple times over the same set of blocks
- IBlockAccessorRevertable
Provides read/write access to the blocks of a world.
- IBlockShapeSupplier
Adds a tesselator to your block WARNING: please make sure whatever functions and fields you use with the OnTesselation event are THREAD SAFE!
- IBulkBlockAccessor
Useful for setting many blocks at once efficiently
- IClassRegistryAPI
Interface for creating instances
- ICollectibleDisplayable
A collectible object that can be placed on the ground or on shelves or in display cases, but require custom code or rendering for it
- ICollectibleOnDisplayInteractable
A collectible object that can be placed on the ground or on shelves or in display cases, but also can still accept interactions from the player
- ICoreAPI
Common API Components that are available on the server and the client. Cast to ICoreServerAPI or ICoreClientAPI to access side specific features.
- ICoreAPICommon
API Methods common to the server and client
- IDrawYAdjustable
Used for blocks (e.g. crops and dead crops) where the y-position might need to be adjusted at the time of tesselating an individual block
- IEventAPI
Events that are available on the server and the client
- IGameCalendar
Main API for retrieving anything calender or astronomy related
- IGeometryTester
Used for blocks (e.g. chiselled blocks) where the basic block geometry: AO shading, side opaque etc - depends on the individual block or blockEntity
- IHeldBag
Bag is a non-placed block container, usually one that is attached to an entity
- IInventory
Basic interface representing an item inventory
- IItemStack
Represents a stack of items or blocks
- ILogger
Interface to the client's and server's event, debug and error logging utilty.
- IMapChunk
Holds 2 dimensional data for one chunk column
- IMapRegion
2D Map data for a 16x16 area of chunk columns. Holds a few maps for the chunk generation.
- IMiniDimension
Provides read/write access to the blocks of a movable mini-dimension.
- IMountable
Represents something the player can mount. Usually a block or an entity.
- IMountableSeat
Represents a seat of a mountable object.
- IParticlePropertiesProvider
Represents a provider of particle properties to be used when generating a particle
- IPlayer
Represents a player
- IPlayerInventoryManager
Let's you do various interesting things with the players inventory.
- IRotatable
Implement this interface if schematics containing this block entity needs to modify it's tree attribute data. Beware, this method is called without the block entity existing in the world (yet). The modified tree will then be used to actually create the block
- IWithDrawnHeight
Used for blocks (e.g. tallgrass and flowers) where the drawnHeight is set in attributes
- IWorldAccessor
Important interface to access the game world.
- IWorldPlayerData
Some world-specific information about a connected player. If you want modify any value, also broadcast the playerdata to all connected clients. This is the object that stored and loaded with the save game
- IXPlatformInterface
The platform interface for various controls. Used by the game to handle various properties.
Enums
- EnumAICreatureType
Types of creatures used for pathfinding. Humanoids prefer taking paths.
- EnumAnimationBlendMode
Defines how multiple animations should be blended together.
- EnumBlockMaterial
Materials of which a block may be made of. Currently only used for mining speed for tools and blast resistance.
- EnumChatType
A definition for the types of chat that could occur.
- EnumEntityAction
A players in-world action
- EnumFoodCategory
Types of nutrition for foods.
- EnumGameMode
A players game mode
- EnumGetClimateMode
The type of climate values you wish to receive
- EnumHabitat
Habitats for entities. Controls some minor logic for entities.
- EnumHandHandling
How the engine should handle attacking with an item in hands
- EnumHandling
Tells the engine how to handle default or subsequent similar behaviors
- EnumItemClass
The type of collectible in an itemstack.
- EnumItemDamageSource
Types for how an item can damage it's durability.
- EnumItemStorageFlags
Determines the kinds of storage types the item can be put into
- EnumLightLevelType
Used in blockAccessor.GetLightLevel() to determine what kind of light level you want
- EnumMatterState
Various states of matter to use for collectibles.
- EnumModSourceType
Represents the origin file type of the mod.
- EnumModType
Describes the type of a mod. Allows easy recognition and limiting of what any particular mod can do.
- EnumMouseButton
A list of mouse buttons.
- EnumParticleModel
Types of model for a particle.
- EnumRandomizeAxes
When picking a random seed for this block, what axes should we base it on?
- EnumReflectiveMode
On the graphics card we have only one reflective bit, but we can store the mode in the wind data bits
- EnumShapeFormat
Types of shape that can be loaded by the game.
- EnumSmeltType
The type of smelting for the collectible. This effects how the object is smelted.
- EnumSoilNutrient
The three types of soil nutrient for farmland and crops.
- EnumTool
Types for each tool in the game. Some of these are unused.
- EnumTransitionType
Types of transition for items.
Delegates
- ActionBoolReturn
Return true if the action/event was successfull
- ActionBoolReturn<T>
Returns true if the action/event was successfull.
- ActionBoolReturn<T1, T2>
Returns true if the action/event was successfull.
- ActionBoolReturn<T1, T2, T3>
Returns true if the action/event was successfull.
- ActionConsumable
Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)
- ActionConsumable<T>
Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)
- ActionConsumable<T1, T2>
Return true if the action/event should be "consumed" (e.g. mark a mouse click as handled)
- CanPlaceOrBreakDelegate
Test if a player has the privilege to modify a block at given block selection
- ChunkColumnBeginLoadChunkThread
Triggered immediately when the server loads a chunk column from disk or generates a new one, in the SupplyChunks thread (not the main thread)
- ChunkColumnLoadedDelegate
Triggered when the server loaded a chunk column from disk or generated a new one
- ChunkColumnUnloadDelegate
Triggered just before a chunk column gets unloaded
- ChunkDirtyDelegate
For handling dirty chunks
- CustomGetTransitionSpeedMulDelegate
Custom transition speed handler
- DialogClickDelegate
The delegate for a dialogue click.
- EventBusListenerDelegate
For handling events on the event bus
- GetMountableDelegate
This method needs to find your mountable based on the tree attribute data, which you can write to in IMountable.MountableToTreeAttributes() For example if its an entity, you will want to store the entity id, then this method can simply contain
return world.GetEntityById(tree.GetLong("entityId"));
- MapRegionLoadedDelegate
Triggered when the server loaded a map region from disk or generated a new one
- MapRegionUnloadDelegate
Triggered just before a map region gets unloaded
- OnInventorySlot
Return false to stop walking the inventory
- PlayerChatDelegate
When the player wrote a chat message. Set consumed.value to true to prevent further processing of this chat message
- PlayerDeathDelegate
When the player died, this delegate will fire.
- SolarSphericalCoordsDelegate
Should return sin(solar altitude angle). i.e. -1 for 90 degrees far below horizon, 0 for horizon and 1 for vertical
- Tag2RichTextDelegate
A tag parser